Skip to content

Path effects applied to annotation text containing \n #4024

Description

@dkirkby

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions