Alan G Isaac wrote:
> I meant to be copying an annotation example from
> http://matplotlib.sourceforge.net/examples/annotation_demo.bak.py
I don't see much resemblance to that example; and I haven't tried that 
example, but I did verify that the examples/annotation_demo.py in svn 
works as expected.
> but it is not working.  Am I just too bleary eyed because it 
> is later here, or is there a problem with the example?
Time for bed, rest those bleary eyes...

The signature of the Annotation.__init__ does not match what you were 
trying to feed it.  Here is a modification that does match, but that may 
not be anything like what you were trying to do:

import pylab
import matplotlib as mpl
test = pylab.figure()
test_ax = test.gca()
test_ax.plot([1,2,3])

a = mpl.text.Annotation(

'F: a figure title (points)',
(-10, -10),
xycoords='figure points',
horizontalalignment='right',
verticalalignment='top',
fontsize=20)

test_ax.add_artist(a)
test.savefig('temp.eps')

------------------
Eric

> 
> Thank you,
> Alan Isaac
> 
> 
> %%%%%%%%%%%%  Illustrate Annotation Problem  %%%%%%%%%%%%%%%%%%%%%
> import pylab
> import matplotlib as mpl
> test = pylab.figure()
> test_ax = test.gca()
> test_ax.plot([1,2,3])
> 
> #the following line fails with "ValueError: too many values to unpack" 
> a = mpl.text.Annotation(
> test,
> 'F: a figure title (points)',
> loc=(-10, -10),
> coords='figure points',
> horizontalalignment='right',
> verticalalignment='top',
> fontsize=20)
> 
> test_ax.add_artist(f)
> test.savefig(r'c:\temp\temp.eps')

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to