0

This is extremely frustrating. Just as I figured out how to get a substantial legend OUT of my plot using the following:

plt.legend(loc="upper left", bbox_to_anchor=(1,0.75))

Now the following command

plt.savefig(r'test'+'.jpeg', dpi=120*4)

outputs an image where the legend is almost completely cut off from the jpeg. I know its there since I can see part of it but the better part is missing.

How can I fix this please? I have tried to implement the solution from this question to no avail. Furthermore the situation is slightly different here since that question had a legendat the bottom of the axes and was not trying to save it to a jpeg like I am.

user32882
  • 5,094
  • 5
  • 43
  • 82
  • You can fix it by playing around with all the parameters available till it works. – wwii Sep 20 '17 at 14:02
  • Care to include a minimal set of your code that we can use to duplicate your figure? It need not include the same data; just the same figure and axes size and enough lines to generate a similar-sized legend that causes the problem. – saintsfan342000 Sep 20 '17 at 14:04

0 Answers0