-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Regression when calling annotate with nan values for the position #12648
New issue
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
Milestone
Comments
Zaharid
added a commit
to NNPDF/nnpdf
that referenced
this issue
Oct 27, 2018
We get nan values as coordinates for the annotate point sometimes. Past versions of MPL knew how to handle this, but it now leads to crashes. We ensure that the coordinates of the point are finite to work around this. The issue is: matplotlib/matplotlib#12648
This is due to b18d16c (#10682) where your annotation is now part of the tight_layout machinery. As a work around, if you do: import matplotlib.pyplot as plt
plt.plot(range(10))
h = plt.annotate('X', (0, float('nan')))
h.set_in_layout(False)
plt.tight_layout()
plt.savefig('crash.png') It works as expected. |
RosalynLP
pushed a commit
to NNPDF/nnpdf
that referenced
this issue
Nov 8, 2018
We get nan values as coordinates for the annotate point sometimes. Past versions of MPL knew how to handle this, but it now leads to crashes. We ensure that the coordinates of the point are finite to work around this. The issue is: matplotlib/matplotlib#12648
Zaharid
added a commit
to NNPDF/nnpdf
that referenced
this issue
Nov 28, 2018
Version 3.0 breaks some behaviour that we rely on. See: matplotlib/matplotlib#12648
This was referenced Jan 24, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following code:
raises an exception when using matplotlib 3, including 3.0.1.
It works fine with matplotlib 2.
Based on the traceback, the following issues might be related:
#10360 (likely this is a duplicate)
#11386
#6789
The snippet has been tested on brand new conda environments with the defaults
channel.
Matplotlib 3 env
Matplotlib 2 conda environment
The issue has been encountered in real code that expects MPL to deal with nan
values properly.
The text was updated successfully, but these errors were encountered: