This page demonstrates Python tips and tricks that I use in my everyday programming as an atmospheric science graduate student.
-Brian Blaylock

Showing posts with label Legend. Show all posts
Showing posts with label Legend. Show all posts

Tuesday, June 16, 2015

Python Legend, put legend outside of plot display

Often when you legend is too large, it is convenient to put it off to the side. Here's how...

from matplotlib import pyplot as plt

plt.plot(a,b, label="legend label")
plt.legend(loc='center left', bbox_to_anchor=(1, 0.5),prop={'size':10})

An example here: