On Sat, 2011-09-17 at 19:19 -0500, John Hunter wrote:

> The artist tutorial covers drawing directly to a figure
> 
> http://matplotlib.sourceforge.net/users/artists.html#figure-container
> 
> I believe you could adapt the patches.FancyArrow to the same approach.

Thanks, John!  I got JJ's approach to work, but I also tried it your way
and it seems to me to generate tidier code.  You don't have to deal with
clip boxes either.

Example:

[code]
aspect = 23.0 / 8.0 # (These are my figure dimensions, X / Y) 
tr = fig.transFigure
w, h = 0.008, 0.02
ha = FancyArrow(0.0175, 0.03, 0.645, 0.0, width=w, head_length=h, \
                transform=tr)
va = FancyArrow(0.0125, 0.045, 0.0, 0.845, width=w/aspect, \
                head_length=h*aspect, transform=tr)
fig.patches.extend([ha, va])
[/code]

So it would appear that the special methods add_axes and add_subplot
exist only so that the "stateful" Matlab-like interface can be informed
as to which Axes object is "current."  For any other object type, you
just add it to the list of the appropriate type in the Figure object.


------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
http://p.sf.net/sfu/rim-devcon-copy2
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to