Hi:
I’m adjusting the y-position of a plot title. Then, I add a legend with loc
set to ‘best’. However, the legend is placed on top of the title.
The following code demonstrates the issue:
import matplotlib.pyplot as plt
plt.close('all')
plt.plot((1,2,3), label='Just a very long legend')
plt.title('Just a very long title 1234567890', y=0.9)
plt.legend(loc='best')
plt.show()
Is this a bug in legend
, or am I missing something? Any advice on how to place the legend using loc=best
without colliding with the title?
4 posts - 2 participants