Top "Legend" questions

A graph legend is commonly used when plotting several sets of data within the same diagram.

Add custom legend without any relation to the graph

I wish to insert a legend that is not related to the graph whatsoever: figure; hold on; plot(0,0,'or'); plot(0,0,…

matlab matlab-figure legend
Setting a fixed size for points in legend

I'm making some scatter plots and I want to set the size of the points in the legend to a …

python legend scatter-plot
Two geom_points add a legend

I plot a 2 geom_point graph with the following code: source("http://www.openintro.org/stat/data/arbuthnot.R") library(…

r ggplot2 legend legend-properties
How to position and align a matplotlib figure legend?

I have a figure with two subplots as 2 rows and 1 column. I can add a nice looking figure legend with …

python matplotlib legend
How do I add two legends to a single plot in MATLAB?

I'd like to add two legends to a plot in MATLAB. How can I do this?

matlab plot legend matlab-figure
change both legend titles in a ggplot with two legends

I have two legends on my ggplot with two different legend titles (automatically created from ggplot()). Now, I want to …

r ggplot2 legend
How to add a legend to matplotlib pie chart?

Using this example http://matplotlib.org/examples/pie_and_polar_charts/pie_demo_features.html how could I add a …

matplotlib legend pie-chart
How to add legend to imshow() in matplotlib

I am using matplotlib In plot() or bar(), we can easily put legend, if we add labels to them. but …

python matplotlib label legend imshow
Stop matplotlib repeating labels in legend

Here is a very simplified example: xvalues = [2,3,4,6] for x in xvalues: plt.axvline(x,color='b',label='xvalues') plt.legend() …

matplotlib legend
Manually set color of points in legend

I'm making a scatter plot which looks like this: (MWE at bottom of question) As can be seen in the …

python numpy matplotlib colors legend