Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I had this issue, and found almost exactly the same problem on Stack Overflow (link)
Briefly, the pyplot.legend does not try to avoid pyplot.text. Here is a minimal example:
import matplotlib.pyplot as plt x = [1, 2] plt.plot(x, x, label='plot name') plt.gca().text(0.05, 0.95, 'some text', transform=plt.gca().transAxes, verticalalignment='top') plt.gca().legend(loc='best') plt.show()
resulting in legend overlaying the text like this:
BTW, my matplotlib version is 3.4.3
The text was updated successfully, but these errors were encountered:
It maybe doesn't unwind the transform to put it in data units instead of transAxes?
Sorry, something went wrong.
Nope, got the same issue with the following code:
import matplotlib.pyplot as plt x = [1, 2] plt.plot(x, x, label='plot name') plt.gca().text(1.05, 2, 'some text', verticalalignment='top') plt.gca().legend(loc='best') plt.show()
Yes, indeed texts are not considered.
matplotlib/lib/matplotlib/legend.py
Line 815 in 40dea5a
Successfully merging a pull request may close this issue.
Uh oh!
There was an error while loading. Please reload this page.
I had this issue, and found almost exactly the same problem on Stack Overflow (link)
Briefly, the pyplot.legend does not try to avoid pyplot.text. Here is a minimal example:
resulting in legend overlaying the text like this:

BTW, my matplotlib version is 3.4.3
The text was updated successfully, but these errors were encountered: