I don't think the transformations framework is going to be of much help 
for automating this.  You seem to be suggesting an x-axis where the 
center is in data coords and the width is in axes coords.  Once you've 
added the two together, it will be impossible to separate them.

I think the path of least resistance will be for you to create a new 
artist class and override the draw method, such that you can do all the 
necessary calculations based on the current values of the axes and data 
transforms on every draw.

There's an example of creating a custom artist in 
api/line_with_text.py...  Then it's just writing a draw method to do 
what you need to do -- you should be able to get at the axes 
transformations through self.axes.transAxes and self.axes.transData.  
I'm a bit busy today to really work that through, but hopefully that's 
enough to get you started.

Mike

Uri Laserson wrote:
> Is it possible to specify a path object that will use different
> transforms for different vertices?
>
> This is again related to plotting a box whose height is specified by
> data coords, but whose width is a constant in axes coords regardless
> of scale (so linear and log x-scales would produce a box of the same
> width).
>
> Ideally, I would draw a path like this:
> 1. the center of the box would be located at x and bottom and top
> would be y1, y2, all in data coords
> 2. I would move to (x,y1) at the bottom-center of the box.
> 3. The x value would now need to be converted to Axes coords, possibly
> by applying transData + transAxes.inverted
> 4. I would want to draw a line to (x-0.1, y1) where x is now in axes
> coords and y is still in data coords.  Then up, then right, then down,
> and then close the polygon.
>
> How do I implement this?
>
> As I mentioned before, a blended transform would allow me to make the
> moves i am interested in.  However, a change of scale would change the
> correspondence between data and axes coords, so the axes transform
> part of the blended axes would have to be recomputed everytime the
> scale changes based on where the (x,y1) point lands in the axes.  Is
> this correct?
>
> Any suggestions are welcome...thanks!
>
> Uri
>
>
>   

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to