Repository navigation
Closed
Labels
Description
I ran cursor.py, downloaded from the matplotlib/examples/widgets web page.
I'm on mac osx 10.9.4, anaconda latest as of today, matplotlib 1.3.1
the output is this:
79-118-141-238:wigets ifmichael$ python cursor.py
Traceback (most recent call last):
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/figure.py", line 1040, in draw
self.canvas.draw_event(renderer)
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 1693, in draw_event
self.callbacks.process(s, event)
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/cbook.py", line 527, in process
proxy(*args, **kwargs)
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/cbook.py", line 405, in __call__
return mtd(*args, **kwargs)
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/widgets.py", line 865, in clear
self.background = self.canvas.copy_from_bbox(self.ax.bbox)
AttributeError: 'FigureCanvasMac' object has no attribute 'copy_from_bbox'
Traceback (most recent call last):
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 1834, in motion_notify_event
self.callbacks.process(s, event)
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/cbook.py", line 527, in process
proxy(*args, **kwargs)
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/cbook.py", line 405, in __call__
return mtd(*args, **kwargs)
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/widgets.py", line 892, in onmove
self._update()
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/widgets.py", line 899, in _update
self.ax.draw_artist(self.linev)
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/axes.py", line 2098, in draw_artist
a.draw(self._cachedRenderer)
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/lines.py", line 526, in draw
gc = renderer.new_gc()
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py", line 97, in new_gc
self.gc.save()
RuntimeError: CGContextRef is NULLMaybe this issue was resolved in 1.4.0, but I cannot install it (see #3517)
Activity
mdboom commentedon Oct 23, 2014
@mdehoon
mdehoon commentedon Oct 24, 2014
Essentially the same issue as #531 . The _update method in lib/matplotlib/widgets.py tries to draw to the canvas directly, rather than through the draw callback (i.e. figure.draw(renderer)). To solve this, the _update method should call draw_if_interactive, which will trigger a call to figure.draw(renderer). This may need some redesign of the copy_from_bbox, restore_region, blit code, but that would be a good thing anyway as it would help towards solving the long-standing issues with the animations code.
WeatherGod commentedon Oct 24, 2014
Makes me glad I have not included the cursor widget into my book yet...
On Thu, Oct 23, 2014 at 9:12 PM, mdehoon notifications@github.com wrote:
tacaswell commentedon Oct 24, 2014
@WeatherGod The cursor works fine on all of the other backends, I think this is just an macosx issue.
WeatherGod commentedon Oct 24, 2014
Right, but what is the default backend when installing matplotlib on Macs?
(I honestly don't know, I am assuming it is the macosx backend).
On Fri, Oct 24, 2014 at 11:16 AM, Thomas A Caswell <notifications@github.com
jenshnielsen commentedon Oct 24, 2014
@WeatherGod Yes on my mac the default backend is OS X
mdehoon commentedon Oct 25, 2014
@tacaswell While the issue only appears in the Mac OS X backend, the bug is actually in the widgets.py code.
jradavenport commentedon Mar 13, 2015
Seems like this is a long-standing issue... is the only workaround to force people to use a different backend? (e.g. u'Qt4Agg', u'TkAgg')
dopplershift commentedon Oct 24, 2017
This is working fine for me on 2.1 (and also works on 2.0.2) with Python 3.6. I bet this was fixed with #6178.
Feel free to re-open if someone is able to reproduce.