Skip to main content

Questions tagged [legend]

A graph legend is commonly used when plotting several sets of data within the same diagram. The legend associates each plot with its corresponding data.

1,296 questions with no upvoted or accepted answers
6 votes
0 answers
1k views

How to get leading whitespace in matplotlib labels (legend or xlabel etc.) using latex?

I would like to insert some leading whitespace into some of my legend labels (problem is the same for other types of labels) with latex turned on. However, any leading whitespace that I enter is being ...
Zaus's user avatar
  • 1,301
6 votes
1 answer
2k views

How to change cursor on plotly graph when mouse hover event occurred?

i'm trying to change cursor from pointer to default when hover event occurred on plotly's graph legend legend: { cursor: "default", x: xLegenda, y: yLegenda, ...
Giuseppe Giubaldo's user avatar
6 votes
0 answers
3k views

Using annotate to place a text box below legend in Matplotlib

I wish to display some text in a Matplotlib plot using annotate(), aligned beneath a legend box. I have examined the solution proposed in How to place a text box directly below legend in matplotlib? ...
Delory's user avatar
  • 71
6 votes
0 answers
11k views

Highcharts legend styling with usehtml

I need to use the pagination of Highcharts (v2.3.5) legend, as my graph use numerous series of data. The thing is I would like to add an image (with a dedicated tooltip) on each legend item, and so ...
user2047243's user avatar
5 votes
0 answers
165 views

How to have a legend for colored edges in Julia plots?

Here is a minimal working code from Julia Discourse: using LightGraphs using GraphPlot using Colors g = graphfamous("karate") membership = [1,1,1,1,1,1,1,1,2,1,1,1,1,1,2,2,1,1,2,1,2,1,2,1,...
JKHA's user avatar
  • 1,876
5 votes
0 answers
281 views

Bokeh: How to hide legends for lines that belong to the same group/category

The scenario is the following: I have a set of data with 2 attributes: year and (export/import) There are 3 choices for years and 2 choices for (export/import) , counting in total 3*2=6 datasets. 1. ...
John's user avatar
  • 388
5 votes
0 answers
4k views

How to remove legend in the default r plot() function

I have a simple R plot (i.e. plot(object)) and would like to suppress the legend. I am not, and cannot, use ggplot - how do I prevent R adding a legend to the plot?
user265883's user avatar
5 votes
0 answers
775 views

How to fit a big legend under a chart?

I have a lot of elements in my graph, which don't fit into one line under the graph. How can I achieve a line break so that all legend's fit under the graph? Here is an example of my use case, copy ...
SiGa's user avatar
  • 187
5 votes
0 answers
488 views

Why legend box size increases when I zoom plot in r?

When I use legend command in r, the size of the legend box is true, but when I zoom plot, the size of the legend box increases with a large scale. Are there any options to set height and width of ...
mohammad's user avatar
  • 175
5 votes
0 answers
348 views

Legend is displaying additional shape

I'm using the following data frame: df1 <- structure(list(Genotype = structure(c(1L, 1L, 1L, 1L, 1L, 2L,2L,2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L,1L, 2L, 2L, 2L, 2L, 2L,...
John Gagnon's user avatar
5 votes
1 answer
5k views

Place MATLAB legend such that it does not overlap on the plot

I am generating multiple plots of different datasets in succession using MATLAB. I would like the legend positions to be such that they don't overlap on the plotted lines and it would be ideal if this ...
Slothworks's user avatar
  • 1,083
5 votes
1 answer
3k views

Highcharts: are multiple legends possible?

I'm new to Highcharts and it seems excellent this far. However, I need to have my six series grouped into three columns in the legend. This can be achieved by limiting legend width and using ...
StackExchange saddens dancek's user avatar
5 votes
1 answer
1k views

How to make a Legend of MatPlotLib patch patterns or add them to a preexisting Legend

How does one make a legend for patch patterns used on a graph or add information on the patch patterns to a preexisting legend without affecting information already present on the legend?
Elliot's user avatar
  • 5,411
4 votes
0 answers
831 views

How to change legend text formatting in Leaflet in R?

I've created a leaflet map and I'm trying to figure out how I can change the formatting of the legend labels. I currently have a gradient color palette to represent the data, with a set of discrete ...
nkt95's user avatar
  • 65
4 votes
0 answers
418 views

R leaflet map - combine layer group selection with the legend?

I know there are several R leaflet threads on here about showing the legend of layers only when those layers are selected using the addLayersControl command. But my questions is slightly different a ...
tfarrugia's user avatar
4 votes
0 answers
573 views

How to manually scale a continuous legend in a seaborn scatterplot?

I'm creating a scatterplot with seaborn like this: plt.figure(figsize=(20,5)) ax = sns.scatterplot(x=x, y=y, hue=errors, s=errors*20, alpha=0.8, edgecolors='w')...
Chris's user avatar
  • 1,306
4 votes
1 answer
327 views

How can I make a cyclic, donut-like color legend in ggplot?

CONTEXT I have some data that looks like this: val = 0:100 sample_data = data.frame( t=val, px=cos(2*pi*val/100), py=sin(2*pi*val/100), v_angle = (val*360/100 + 90) %% 360 ) I am ...
Max Candocia's user avatar
  • 4,407
4 votes
1 answer
1k views

R ggplot 2 legend border issue

I know this is minor, but it's for a publication and will drive me crazy. The bottom of the P0688 box is like 1-2 pixels thinner than the rest. I don't want to make the borders thicker because then it ...
Paul Manley's user avatar
4 votes
0 answers
3k views

how to give custom design (icons) for point Style of chart js legends?

I have a chart which designed based on a mock-up but the the mock-up chart has used custom icons for legends pointStyles which basically i couldn't find them in chart JS itself, i tried different ...
Sajad Haibat's user avatar
4 votes
0 answers
3k views

matplotlib: multiple legends in each single subplot

I know how to split the legend of a plot into two separate legends: x = np.linspace(0,1) y1 = x y2 = 2*x fig, ax = plt.subplots() fig.set_size_inches((8,8)) points = [] pnts = ax.scatter(x, y1, c='...
GRquanti's user avatar
  • 534
4 votes
1 answer
1k views

How to reduce white space in octave legend function

I have build some algorithm and now I should make things pretty enough for presentation. Only problem what I have is a "strange" legend behaviour in octave. I dont know if the problem is because I am ...
Pukaai's user avatar
  • 377
4 votes
0 answers
2k views

Safari 11 Bug Fieldset-Legend with Overflow Hidden and Click

Since Safari 11 for Mac checkboxes (and links/other click-events) are inaccessible when placed in a <legend>, does anyone know of a workaround? JS fiddle contains a demo, neither the checkbox ...
elveti's user avatar
  • 2,356
4 votes
0 answers
450 views

in R, creating multi column legend in ggplotly

How do you spread a legend over multiple columns in ggplotly? The answer here makes it obvious how to do so using ggplot() - however that code doesn't seem to work when I use ggplotly() library(...
val's user avatar
  • 1,689
4 votes
1 answer
945 views

JVectorMap: update legend

I'm using JVectorMap to show a map with colored countries. The map also includes a legend and an onRegionTipShow. In my application it's possible to alter the values the map is based on. After doing ...
Newton's user avatar
  • 53
4 votes
0 answers
7k views

r-legend in stacked bar plot

I'm relatively new to R and struggling to get my legend in the correct place. I've had a good look online and just can't seem to figure it out. # rating no yes # 1 140 38 # 2 72 46 # ...
N Gross's user avatar
  • 41
4 votes
0 answers
2k views

Plot legend problems using R. Help removing excessive white space in legend box

I am creating a plot of some hydrology data and I am having trouble with the legend. The legend has a large amount of blank space around the text. I have tried using par(mar= list), cex, x.intersp, ...
blinid's user avatar
  • 41
4 votes
0 answers
3k views

How to properly propagate multiplex signal names to scope legend via bus system? (Simulink)

I substituted my originial question, the problem is still the same, but the conditions are now different. To review the original question, have a look at the revisions. I'm looking for a way to ...
Robert Seifert's user avatar
3 votes
0 answers
97 views

In a quiver plot with ShowArrowHead = 'off', how do I keep the arrowhead from displaying in the legend as well?

When plotting with quiver() and setting the 'ShowArrowHead' property to 'off', the arrowheads aren't shown in the plot (as expected). However, the legend entry still shows an arrowhead. I would expect ...
localhost's user avatar
3 votes
0 answers
62 views

Plot a boolean/qualitative table with R

I am looking for a way to create a table in R for categorical data. The elements in the table should be symbols, and these symbols should be displayed in a legend. This table from the ICILS 2018 ...
saykodelikat's user avatar
3 votes
0 answers
249 views

Plotly legend marker opacity and spacing

Is it possible to access the symbols in a legend? I would like to set their opacity to a higher value than the opacity of my trace markers, and ideally I would like to make them tighter (in the sense ...
Tim Kirkwood's user avatar

15 30 50 per page
1
2 3 4 5
44