You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In text.py, in function "draw", the values returned by the line "posx, posy = trans.transform_point((posx, posy))" can set Nan values into posx and pos variables. Thus, the following test in the function "if not np.isfinite(x) or not np.isfinite(y):" is too early as "x = x + posx" is called afterwards. Thus it wil crashes in the following call to the draw_text function :
The following python error occurred:
ValueError('cannot convert float NaN to integer',)
File "/lib/python2.7/site-packages/matplotlib/backends/backend_agg.py", line 198, in draw_text
font.get_image(), np.round(x - xd), np.round(y + yd) + 1, angle, gc)
Please find the patch below that just moves the test :
Index: /matplotlib-1.4.0/lib/matplotlib/text.py
===================================================================--- /matplotlib-1.4.0/lib/matplotlib/text.py (révision 78983)+++ /matplotlib-1.4.0/lib/matplotlib/text.py (copie de travail)@@ -561,14 +561,15 @@
angle = self.get_rotation()
for line, wh, x, y in info:
- if not np.isfinite(x) or not np.isfinite(y):- continue-
mtext = self if len(info) == 1 else None
x = x + posx
y = y + posy
if renderer.flipy():
y = canvash - y
++ if not np.isfinite(x) or not np.isfinite(y):+ continue+
clean_line, ismath = self.is_math_text(line)
if self.get_path_effects():
You can reproduce this configuration by zooming in a polar plot.
[tac edited for markup]
The text was updated successfully, but these errors were encountered:
@ffteja Can you make a pull request with that patch applied? Doing so makes it a bit easier on us to review (which in this case isn't a huge deal) and makes sure you get credit for your contribution.
In text.py, in function "draw", the values returned by the line "posx, posy = trans.transform_point((posx, posy))" can set Nan values into posx and pos variables. Thus, the following test in the function "if not np.isfinite(x) or not np.isfinite(y):" is too early as "x = x + posx" is called afterwards. Thus it wil crashes in the following call to the draw_text function :
Please find the patch below that just moves the test :
You can reproduce this configuration by zooming in a polar plot.
[tac edited for markup]
The text was updated successfully, but these errors were encountered: