Questions tagged [legend-properties]

legend-properties refers to various chart libraries and the ability to programmatically customise legends in charts generated by those libraries.

legend-properties refers to various chart libraries and the ability to programmatically customise legends in charts generated by those libraries. Examples for proper use of the tag is :

413 questions
5
votes
1 answer

pyplot: change ncols within a legend

I'm plotting a large data set and some regressions in pyplot. The data is colored according to an additional value. I decided to set the number of columns in the legend to 2. It looks nice for the data points, but for the regressions, I'd like to go…
Tyrax
  • 223
  • 2
  • 3
  • 7
5
votes
1 answer

ggplot2 draws two legends

I have almost complete the following graph, but there is one problem with it. The legend in the graph is drawn twice. Here is the data: structure(list(Period = c("January 1997 - August 2003", "September 2003 - Jun 2005", "Jul 2005 - Dec 2009",…
user1738753
  • 626
  • 4
  • 12
  • 19
4
votes
1 answer

Jfreechart - how to add a legend item with a dash?

I want to add a legend item with a dash (-) to denote some series in my chart. The default shape provided are only Plot.DEFAULT_LEGEND_ITEM_CIRCLE and Plot.DEFAULT_LEGEND_ITEM_BOX. Is there something like Plot.DEFAULT_LEGEND_ITEM_LINE ? How to…
sam
  • 651
  • 3
  • 9
  • 16
4
votes
1 answer

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 using "subplot" function, but I have tried…
Pukaai
  • 367
  • 1
  • 4
  • 14
4
votes
1 answer

Add legends to nested pie charts

I want to add a legend in the inner pie chart of a nested pie chart plot: import matplotlib.pyplot as plt # Make data: I have 3 groups and 7 subgroups group_names=['groupA', 'groupB', 'groupC'] group_size=[12,11,30] subgroup_names=['A.1', 'A.2',…
Laura
  • 1,192
  • 2
  • 18
  • 36
4
votes
3 answers

Legend; text/description before key/colour?

By default MATLAB puts the text part of a legend entry after the sample of what is used in the plot. Is there any way to reverse this? For example, using the below code the first entry in the legend is a dark blue rectangle followed by the text I'm;…
Steve
  • 614
  • 1
  • 10
  • 20
4
votes
1 answer

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 so, the map should be updated including colors,…
Newton
  • 53
  • 7
4
votes
2 answers

User defined legend in python

I have this plot in which some areas between curves are being filled by definition. Is there any way to include them in legend? Especially where those filled areas are overlapped and as well as that a new and different color is being appeared. Or…
Shivid
  • 1,295
  • 1
  • 22
  • 36
4
votes
0 answers

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 # 3 46 62 # 4 42 140 # 5 16 …
N Gross
  • 41
  • 1
  • 2
4
votes
1 answer

How to link plotly traces for legend and colour selection?

Problem I am migrating a number of ggplot/ggvis plots to plotly in a shiny application. There is an issue I've encountered regarding the linking of traces. I want to be able to show/hide traces by group on the legend, which is shared between related…
Kevin Arseneau
  • 6,186
  • 1
  • 21
  • 40
4
votes
1 answer

Add title text to legend block in octave

I'm trying to add a title to the legend block in a plot I've got in Octave (like this). I've had a dig through the properties that are available on the plot and have found the 'title' attribute, but when I set it there's no change on the plot.…
Tim S
  • 55
  • 1
  • 6
4
votes
2 answers

Matlab two different colors in same line in legend

In Matlab, the following generates a black color on the specified line in the legend: leftAxis = sprintf('left y-axis','Color','r'); leg = legend([.. bla bla ..], sprintf('test [%s]', leftAxis), etc... ); What I'm trying to achieve is two colors on…
Jean-Paul
  • 19,910
  • 9
  • 62
  • 88
4
votes
1 answer

How to add a custom legend for geom_hline

Using the data below, notice the legend does not properly describe geom_hline: df<-data.frame( points=c(.153,.144,.126,.035, .037, .039, .010,.015,.07), days=gl(3,1,9,labels=c("Sun","Mon","Tues")), …
blehman
  • 1,870
  • 7
  • 28
  • 39
4
votes
2 answers

Grand Totals in HighCharts Pie Chart Legend

Is there a way for me to get a grand total at the end of my value column in my legend? Here is the code for my legend right here as well as the fiddle wtih it broken into two columns for the name and value of the data[] set. legend: { …
Nick G
  • 1,209
  • 8
  • 34
  • 58
4
votes
1 answer

Write x̄ (meaning average) in legend and how to prevent linebreak?

Good day! I am not that familiar to R so I'd be glad to get a little help. Assume I have the following minimal example: test <- c(10,20,40,80,80) avg <- mean(test) avg <- format(avg,digits=2) plot(test, xlab="x", ylab="y", pch =…
Gnark
  • 4,080
  • 7
  • 33
  • 44