When I try using axes.add_artist() to add an Annotation object, it does not
work. Adding a Text object in this manner works fine. Shouldn't Annotation
also work since it inherits from Text? The sample code below demonstrates. I
am using version 0.98.3.
from matplotlib.pyplot import figure, show
from matplotlib.text import Text
from matplotlib.text import Annotation
fig = figure()
ax = fig.add_subplot(111)
text = Text(0, 0, 'This is Text')
ann = Annotation('This is an Annotation', (1, 1))
ax.annotate('This is another Annotation', (2, 2))
ax.add_artist(text)
ax.add_artist(ann) #this does not work
ax.set_xlim(-1, 5)
ax.set_ylim(-1, 5)
show()
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users