Repository navigation
Closed
Description
The matplotlib xkcd example plots at
http://matplotlib.org/examples/showcase/xkcd.html
stopped working with matplotlib 1.4.x (they used to work with earlier versions). This is with Python 2.7.5 on Mac OS X 10.9.5 and matplotlib 1.4.3.
The following Traceback is printed if I run one of the examples:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/matplotlib/artist.py", line 59, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Library/Python/2.7/site-packages/matplotlib/figure.py", line 1085, in draw
func(*args)
File "/Library/Python/2.7/site-packages/matplotlib/artist.py", line 59, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Library/Python/2.7/site-packages/matplotlib/axes/_base.py", line 2110, in draw
a.draw(renderer)
File "/Library/Python/2.7/site-packages/matplotlib/artist.py", line 59, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Library/Python/2.7/site-packages/matplotlib/lines.py", line 715, in draw
drawFunc(renderer, gc, tpath, affine.frozen())
File "/Library/Python/2.7/site-packages/matplotlib/lines.py", line 1072, in _draw_lines
self._lineFunc(renderer, gc, path, trans)
File "/Library/Python/2.7/site-packages/matplotlib/lines.py", line 1112, in _draw_solid
renderer.draw_path(gc, path, trans)
File "/Library/Python/2.7/site-packages/matplotlib/patheffects.py", line 115, in draw_path
rgbFace)
File "/Library/Python/2.7/site-packages/matplotlib/patheffects.py", line 217, in draw_path
renderer.draw_path(gc, tpath, affine, rgbFace)
File "/Library/Python/2.7/site-packages/matplotlib/backends/backend_macosx.py", line 58, in draw_path
gc.draw_path(path, transform, linewidth, rgbFace)
AttributeError: GraphicsContextBase instance has no attribute 'draw_path'
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/matplotlib/artist.py", line 59, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Library/Python/2.7/site-packages/matplotlib/figure.py", line 1085, in draw
func(*args)
File "/Library/Python/2.7/site-packages/matplotlib/artist.py", line 59, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Library/Python/2.7/site-packages/matplotlib/axes/_base.py", line 2110, in draw
a.draw(renderer)
File "/Library/Python/2.7/site-packages/matplotlib/artist.py", line 59, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Library/Python/2.7/site-packages/matplotlib/axis.py", line 1119, in draw
tick.draw(renderer)
File "/Library/Python/2.7/site-packages/matplotlib/artist.py", line 59, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Library/Python/2.7/site-packages/matplotlib/axis.py", line 244, in draw
self.tick1line.draw(renderer)
File "/Library/Python/2.7/site-packages/matplotlib/artist.py", line 59, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Library/Python/2.7/site-packages/matplotlib/lines.py", line 760, in draw
rgbaFace)
File "/Library/Python/2.7/site-packages/matplotlib/patheffects.py", line 127, in draw_markers
**kwargs)
File "/Library/Python/2.7/site-packages/matplotlib/backend_bases.py", line 265, in draw_markers
rgbFace)
File "/Library/Python/2.7/site-packages/matplotlib/patheffects.py", line 115, in draw_path
rgbFace)
File "/Library/Python/2.7/site-packages/matplotlib/patheffects.py", line 217, in draw_path
renderer.draw_path(gc, tpath, affine, rgbFace)
File "/Library/Python/2.7/site-packages/matplotlib/backends/backend_macosx.py", line 58, in draw_path
gc.draw_path(path, transform, linewidth, rgbFace)
AttributeError: GraphicsContextBase instance has no attribute 'draw_path'
Activity
mdboom commentedon Sep 11, 2015
Seems to be specific to the macosx backed. Cc: @mdehoon
mdehoon commentedon Sep 11, 2015
Why, on line 217 in patheffects.py, is renderer.draw_path(gc, ...) being called on a RendererMac object while gc is a GraphicsContextBase instead of a GraphicsContextMac? I suspect a call to
is missing, but it may be some deeper problem.
tacaswell commentedon Sep 12, 2015
Is this related to #4024 ?
mdehoon commentedon Sep 14, 2015
@tacaswell I think what we are seeing here is a more fundamental issue. If we solve this one then #4024 will likely also be solved; the opposite is not true though.
mdehoon commentedon Oct 5, 2015
The equivalent bug appears with the gtkcairo backend:
The origin of the bug is the same: The gtkcairo renderer is used with a generic (GraphicsContextBase) graphics context instead of a GraphicsContextCairo graphics context.
mdehoon commentedon Oct 9, 2015
Also broken in the same way with the GTK backend:
and with the ps backend:
Fix PathEffect rendering on some backends