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
{{ message }}
Repository navigation
Path effects applied to annotation text containing \n #4024
I am using the following test program with mathplotlib 1.4.0 (via anaconda) on OS X 10.10.1:
import matplotlib.pyplot as plt
import matplotlib.patheffects as pe
plt.subplot(1,1,1)
plt.annotate('line1\nline2',xy=(0.5,0.5),xycoords='axes fraction',fontsize='x-large',
path_effects=[pe.withStroke(linewidth=1,foreground='r')])
plt.show()
This fails with:
AttributeError: GraphicsContextBase instance has no attribute 'draw_path'
Removing the \n from the text or removing the path_effects option both run as expected. Any workarounds you can suggest are appreciated.
Activity
cimarronm commentedon Mar 7, 2015
Definitely a problem with the MacOS backend and probably affects other backends which use a stack-based graphics context
cimarronm commentedon Mar 8, 2015
@dkirkby This should be resolved with PR #4201 and #4202.
The workaround without these fixes applied is to separate out the annotation into separate annotations (without the newline).
FIX: implement get_rgb for GraphicsContextCairo
FIX: implement get_rgb for GraphicsContextCairo
jenshnielsen commentedon Aug 6, 2015
I don't think this is fixed for OSX so I will reopen #4542 fixed it for Cairo which caused this to auto close
tacaswell commentedon Aug 9, 2015
not blocking 1.5 on this unless @mdehoon wants to.
Fix PathEffect rendering on some backends