
python - Adding a matplotlib legend - Stack Overflow
How can one create a legend for a line graph in Matplotlib's PyPlot without creating any extra variables? Please consider the graphing script below: if __name__ == '__main__': …
How to specify legend position in graph coordinates
Its not exactly clear in how far the solution from the linked question do not help you as by default the bbox_to_anchor argument takes the axes coordinates, just as you want it to be. You may …
How to change legend fontsize with matplotlib.pyplot
Simple question here: I'm trying to get the size of my legend using matplotlib.pyplot to be smaller (i.e., the text to be smaller). The code I'm using goes something like this: plot.figure() plot.
python - How to put the legend outside the plot - Stack Overflow
seaborn is a high-level api for matplotlib. From seaborn v0.11.2, there is sns.move_legend as shown at Move seaborn plot legend to a different position. All of the parameters for .legend …
My matplotlib.pyplot legend is being cut off - Stack Overflow
Mar 11, 2012 · My matplotlib.pyplot legend is being cut off Asked 13 years, 9 months ago Modified 1 year, 6 months ago Viewed 133k times
python - How to manually create a legend - Stack Overflow
I am using matplotlib and I would like to manually add items to the legend that are a color and a label. I am adding data to to the plot to specifying there would lead to a lot of duplicates. My th...
Secondary axis with twinx (): how to add to legend
I have a plot with two y-axes, using twinx(). I also give labels to the lines, and want to show them with legend(), but I only succeed to get the labels of one axis in the legend: import numpy as np
Remove the legend on a matplotlib figure - Stack Overflow
Here is a more complex example of legend removal and manipulation with matplotlib and seaborn dealing with subplots: From seaborn, get the Axes object created by sns.<some_plot>() and …
Create a legend with pandas and matplotlib.pyplot
Feb 27, 2014 · This is my first attempt at plotting with python and I'm having problems creating a legend. These are my imports: import matplotlib.pyplot as plt import pandas I load my data like …
Duplicate items in legend in matplotlib? - Stack Overflow
Oct 15, 2013 · I am trying to add the legend to my plot with this snippet: import matplotlib.pylab as plt fig = plt.figure() axes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range …