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.
legend
1,296
questions with no upvoted or accepted answers
3
votes
0
answers
11k
views
How to change legend labels in ggplot2 for visualizing data in R?
I am using ggplot2 to visualize some data in R.
Therefore I use the following command:
ggplot(second_sentiment_counts)+
aes(x = sentiment, y = n, fill = as.factor(sentiment)) +
geom_bar(stat = "...
3
votes
1
answer
2k
views
Plotting titles and legends on interactive igraph plot? (R)
I'm having trouble adding a title and legend to the inside of my graph. Is it not possible with tkplot OR plot?
dff <- data.frame(a = c(0,1,2,3,4),b = c(3,4,5,6,7))
nod <- data.frame(...
3
votes
0
answers
193
views
legend changes unexpectedly with ggplot2
Any idea why this happens? Reversing the order of the legend changes it quite substantially.
ggplot(mtcars, aes(x = disp, y = mpg, colour = disp, size = disp)) +
geom_point() +
...
3
votes
0
answers
128
views
How can i adjust the spacing between individual labels in the legend in R?
I am trying to adjust the spaces between individual labels in the legend so that I can see all 9 labels but unfortunately I was not successful. Here is my code to generate the boxplots
# raw counts
...
3
votes
0
answers
424
views
how to update legend data in D3.js
I am working on one project in which I need to plot data on USA map.
Here is the link to the code.
I am getting logical error in the output. In the drop down menu of attributes, when you first select ...
3
votes
4
answers
2k
views
ggplot has two legends and the wrong shape shows up in the color legend
I am creating a graph use ggplot in R but the legend is not showing up properly. First, I am getting two legends, one for color and one for linetype. These are both showing up despite the fact that I ...
3
votes
1
answer
911
views
How can I add an event to chart.js legend?
Based on this post I've been able to add the event, but it's not triggered. Any idea why? I'm using the default chart.js legend.
Chart.helpers.each(vm.chart.legend.legendItems, function(legendNode, ...
3
votes
1
answer
786
views
Chart js maximum number of legend
I want to know how to fix the maximum number of legend.
If this is not possible I would like to hide all legends
Thank you
My code ......................................................................
3
votes
0
answers
7k
views
ggplot different legends for different facets
I'd like to use different legends for 2 of the facets in this plot. The facets for 'Sharks' and 'Tunas' include multiple fish species, so I would like each facet to contain a unique legend for those ...
3
votes
0
answers
468
views
How do I get the legend tick marks to be properly positioned using heatmap.2 in R?
I am relatively new to R and am trying to use heatmap.2(). I have found it to be a great tool, except there is one detail that is driving me crazy. The tick marks in the legend do not line up ...
3
votes
1
answer
184
views
Dygraph should show interpolated values in the Legend
I have data fields with null or NaN values. Dygraph just hides them in the legend. But i want dygraph to show interpolated values instead.
Can i do that with the valueformatter ? For now i am using ...
3
votes
0
answers
1k
views
\mathrm mode for legend labels and legend props in matplotlib
So I am having a little alignment issue with my legend in matplotlib. Hopefully it is easily solvable with the right know-how. I have scoured the matplotlib website but I'm struggling to find the ...
3
votes
1
answer
1k
views
Getting legend out of the plot in chart.TimeSeries in R
Suppose I have the following data:
data<- structure(c(103.7, 103.2, 103.1, 105.4, 102.1, 103.5, 103.1,
102.6, 102.2, 104.6, -2.1, -1.4, -2.6, 1.9, -0.7, 1.4, -0.6,
-1.3, -...
3
votes
0
answers
508
views
How to change the group icon in legend via Python in QGIS 2.6
I would want that group created by plugin differs from the group created by man. ;)
How to change the group icon in legend via Python in QGIS 2.6? At version 1.x I did it this way:
self.legendTree = ...
3
votes
0
answers
1k
views
Transform legend when using geom_point and geom_tile for discrete scales (ggplot2)
I am trying to plot trends in precipitation from different simulations. I have a data frame, called df, of this kind:
Type season X Y Val
1 25 Ana Annual 76000 2393000 9.724501
2 ...