Skip to main content

All Questions

1 vote
1 answer
37 views

How to change legend key shape for ggtree [closed]

I am working with a ggtree plot. The data used is available here. Load required packages #load libraries pacman::p_load( here, dplyr, googlesheets4, ...
0 votes
0 answers
29 views

How to plot the legend with combined_plot (ggplot2)

I created this script to display some environmental impacts for my research. `legend_plot <- ggplot(data_longGW, aes(x = Crop_cycleGW, y = kg_CO2_eq, fill = Category)) + geom_bar(stat = "...
1 vote
1 answer
29 views

Showing or saving only the legend of a plotly figure

Given a plotly figure with traces and a legend, is there a way to only show the legend without any of the plot content? My use case for this: I'm exporting several images with the same legend. Instead ...
3 votes
3 answers
3k views

remove strikethrough behavior in chart.js bar chart

i am trying to change the look of the legends by removing the strikethrough effect , wihtout using legendCallback function in chart.js. The reason why i do not want to use the legendCallback function ...
114 votes
4 answers
149k views

How to move or position a legend in ggplot2

I'm trying to create a ggplot2 plot with the legend beneath the plot. The ggplot2 book says on p 112 "The position and justification of legends are controlled by the theme setting legend.position, ...
4 votes
2 answers
14k views

How can I put different legends to subplots in plotly?

I am still designing what kind of plot with subplots I want to do but when we see the example in the documentation Multiple Subplots with Titles we have from plotly.subplots import make_subplots ...
0 votes
0 answers
13 views

Matplotlib not changing legend labels for a plot in python package pyAT

So I am attempting to use a python interface of Accelerator Toolbox (pyAT: link here) to simulate the path of a few particles through an energy spectrometer. From this interface, I've utilized a ...
0 votes
0 answers
28 views

ggplot legend in R not recognising aesthetic changes for label category with no data points

Consider the following image: Although the underlying dataset does not contain values below 0.1 degrees Celsius, I want to and still can force the legend to display the label and box for 'Below 0.1', ...
2 votes
2 answers
1k views

How to change the font family of matplotlib legend AND legend title?

I would like to use the font family "Consolas" in my matplotlib legend in order to benefit the monospaced font. I also want a legend title. But it seems that when I change the font family of ...
0 votes
1 answer
56 views

Force keys size to be smaller in multiple lines legend in ggplot

Is there any way to force legend key sizes to be independent from line height when we have legend text with multiple lines? I tried legend.key.height, ggtext::element_textbox_simple, and guides but ...
0 votes
2 answers
61 views

legend in bokeh UMAP shows only one entry

Hi there I just managed to get this plot done in bokeh, so I imagine there are many things that could be improved. Nonetheless, what bothers me the most is that I cannot figure out how to have all ...
61 votes
4 answers
106k views

Is it possible to add a string as a legend item

I am producing some plots in matplotlib and would like to add explanatory text for some of the data. I want to have a string inside my legend as a separate legend item above the '0-10' item. Does ...
1 vote
1 answer
80 views

plotly title_side position not working properly

I'm greenhand with Python plots but I was trying to do a PCA for different human populations; while I'm still working on the actual data, the main issue I'm having with visualizations in Python, as ...
7 votes
2 answers
14k views

Add horizontal lines to stacked barplot in ggplot2 in R, and show in legend

I have a stacked barplot, something like the example below. I want to add one or two sets of horizontal lines (specifying colour and line type) across each bar, at different values for each bar, and ...
0 votes
1 answer
258 views

ChartJS Customised tooltip and LegendText not displaying after version update

Earlier i was using 2.7.2 version of ChartJS, now im updating to 4.4.1 So in my chart i was creating customized tooltip and customized Legend text but after version update both are not working Here is ...

15 30 50 per page
1
2 3 4 5
17