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:
It works... but if the label is too long, it gets cut. How do you increase the size of the region outside the frame, to make sure that does not happen?
ReplyDeleteHmmm, I haven't run into that problem before. You may need to make the figure bigger, or use plt.subplots_adjust() to add space to one side.
ReplyDeletehttp://matplotlib.org/examples/pylab_examples/subplots_adjust.html