About 51 results
Open links in new tab
  1. 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__': …

  2. 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 …

  3. How to change legend fontsize with matplotlib.pyplot

    plt.legend(fontsize=20) # using a size in points plt.legend(fontsize="x-large") # using a named size With this method you can set the fontsize for each legend at creation (allowing you to have …

  4. 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...

  5. How to add legend to imshow() in matplotlib - Stack Overflow

    Aug 25, 2014 · 20 I am using matplotlib In plot() or bar(), we can easily put legend, if we add labels to them. but what if it is a contourf() or imshow() I know there is a colorbar() which can …

  6. How to place two different legends on the same graph

    I actually build the legend based on colors, associating each color with the corresponding parameter. Now I'd like to display a second legend on the same graph, with the meaning of …

  7. How do I make a single legend for many subplots? - Stack Overflow

    I am plotting the same type of information, but for different countries, with multiple subplots with Matplotlib. That is, I have nine plots on a 3x3 grid, all with the same for lines (of course,

  8. How to specify legend position in graph coordinates

    According to the matplotlib legend documentation: The location can also be a 2-tuple giving the coordinates of the lower-left corner of the legend in axes coordinates (in which case …

  9. My matplotlib.pyplot legend is being cut off - Stack Overflow

    Mar 11, 2012 · I'm attempting to create a plot with a legend to the side of it using matplotlib. I can see that the plot is being created, but the image bounds do not allow the entire legend to be …

  10. 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 …