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 this interactive code, the "pick_event" is used to connect clicks on the x-label, legend's items,
and to react when the annotation is dragged. This was working up to matplotlib 2.2.3.
Since matplotlib 3.0, these behaviors are disrupted.
The problem is in the definition of the arrowprops. When I comment the line with arrowprops,
the code works again. Unfortunately, I loose the stem of the annotation.
Traceback (most recent call last):
File "/Users/dfadda/anaconda3/lib/python3.6/site-packages/matplotlib/cbook/__init__.py", line 215, in process
func(*args, **kwargs)
File "/Users/dfadda/anaconda3/lib/python3.6/site-packages/matplotlib/backend_bases.py", line 1675, in pick
self.figure.pick(mouseevent)
File "/Users/dfadda/anaconda3/lib/python3.6/site-packages/matplotlib/artist.py", line 447, in pick
a.pick(mouseevent)
File "/Users/dfadda/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_base.py", line 4141, in pick
martist.Artist.pick(self, args[0])
File "/Users/dfadda/anaconda3/lib/python3.6/site-packages/matplotlib/artist.py", line 447, in pick
a.pick(mouseevent)
File "/Users/dfadda/anaconda3/lib/python3.6/site-packages/matplotlib/artist.py", line 429, in pick
inside, prop = picker(self, mouseevent)
File "/Users/dfadda/anaconda3/lib/python3.6/site-packages/matplotlib/offsetbox.py", line 1698, in artist_picker
return self.ref_artist.contains(evt)
File "/Users/dfadda/anaconda3/lib/python3.6/site-packages/matplotlib/text.py", line 2184, in contains
contains, tinfo = Text.contains(self, event)
File "/Users/dfadda/anaconda3/lib/python3.6/site-packages/matplotlib/text.py", line 213, in contains
l, b, w, h = self.get_window_extent().bounds
File "/Users/dfadda/anaconda3/lib/python3.6/site-packages/matplotlib/text.py", line 2359, in get_window_extent
self.update_positions(renderer)
File "/Users/dfadda/anaconda3/lib/python3.6/site-packages/matplotlib/text.py", line 2215, in update_positions
self._update_position_xytext(renderer, xy_pixel)
File "/Users/dfadda/anaconda3/lib/python3.6/site-packages/matplotlib/text.py", line 2298, in _update_position_xytext
pad = renderer.points_to_pixels(4)
AttributeError: 'NoneType' object has no attribute 'points_to_pixels'
Expected outcome
Up to matplotlib version 2.2.3, when clicking:
the 'X' label
an item in the legend
the annotation 'note'
the onpick function was called and the event.artist was printed.
The annotation was also draggable.
In version 3.0, all this does not work anymore, producing the output on the screen described.
When commenting the line with "arrowprops", the previous behavior is restaured.
Unfortunately, when doing so, it is not possible to trace the connection with the note.
Matplotlib version
Operating system: mac osx
Matplotlib version: 3.0 (it was working up to version 2.2.3)
Thanks for the report. This problem does not seem to occur in the current development version ("master" branch). I would guess this has been fixed by #12012 and should hence be included in the next bugfix release 3.0.1.
Bug report
Bug summary
In this interactive code, the "pick_event" is used to connect clicks on the x-label, legend's items,
and to react when the annotation is dragged. This was working up to matplotlib 2.2.3.
Since matplotlib 3.0, these behaviors are disrupted.
The problem is in the definition of the arrowprops. When I comment the line with arrowprops,
the code works again. Unfortunately, I loose the stem of the annotation.
Code for reproduction
Actual outcome
Expected outcome
Up to matplotlib version 2.2.3, when clicking:
the 'X' label
an item in the legend
the annotation 'note'
the onpick function was called and the event.artist was printed.
The annotation was also draggable.
In version 3.0, all this does not work anymore, producing the output on the screen described.
When commenting the line with "arrowprops", the previous behavior is restaured.
Unfortunately, when doing so, it is not possible to trace the connection with the note.
Matplotlib version
print(matplotlib.get_backend())
): Qt5AggMatplotlib was installed with conda, default channel.
The text was updated successfully, but these errors were encountered: