Re: [Matplotlib-users] Path object where different vertices use different transforms?

2009-09-29 Thread Uri Laserson
Thanks so much for all the help! If my effort will produce something nice, I'll forward it on... Uri On Mon, Sep 28, 2009 at 23:38, Jae-Joon Lee lee.j.j...@gmail.com wrote: The exception will go away if you explicitly use np.array as below.     box = np.array([[self.x, self.y1],            

[Matplotlib-users] Path object where different vertices use different transforms?

2009-09-28 Thread Uri Laserson
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

Re: [Matplotlib-users] Path object where different vertices use different transforms?

2009-09-28 Thread Michael Droettboom
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

Re: [Matplotlib-users] Path object where different vertices use different transforms?

2009-09-28 Thread Eric Firing
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

Re: [Matplotlib-users] Path object where different vertices use different transforms?

2009-09-28 Thread Michael Droettboom
If I understand correctly, the top and bottom of the box are in data coordinates, the x-center of the box is in data coordinates, only the width of the box is in axes coordinates. Is that correct? If so, a PolyCollection won't be able to do this (directly), since that would require both the

Re: [Matplotlib-users] Path object where different vertices use different transforms?

2009-09-28 Thread Uri Laserson
On Mon, Sep 28, 2009 at 16:03, Michael Droettboom md...@stsci.edu wrote: If I understand correctly, the top and bottom of the box are in data coordinates, the x-center of the box is in data coordinates, only the width of the box is in axes coordinates.  Is that correct?  If so, a That's

Re: [Matplotlib-users] Path object where different vertices use different transforms?

2009-09-28 Thread Jae-Joon Lee
On Mon, Sep 28, 2009 at 4:15 PM, Uri Laserson laser...@mit.edu wrote: On Mon, Sep 28, 2009 at 16:03, Michael Droettboom md...@stsci.edu wrote: If I understand correctly, the top and bottom of the box are in data coordinates, the x-center of the box is in data coordinates, only the width of the

Re: [Matplotlib-users] Path object where different vertices use different transforms?

2009-09-28 Thread Michael Droettboom
Is the attached sort of what you want? It defines a custom rectangle by (x, w, y1, y2) and overrides the get_transform of the patch to update itself at draw time. Mike Uri Laserson wrote: On Mon, Sep 28, 2009 at 16:03, Michael Droettboom md...@stsci.edu wrote: If I understand correctly,

Re: [Matplotlib-users] Path object where different vertices use different transforms?

2009-09-28 Thread Uri Laserson
Hi Mike, This is definitely on the right track. Thanks a lot for writing it out. When I change the view limits, indeed the width stays constant while the height gets rescaled. However, when I try to change to a logarithmic axis, I get the following errors. Again, excuse my ignorance, but I am

Re: [Matplotlib-users] Path object where different vertices use different transforms?

2009-09-28 Thread Uri Laserson
On Mon, Sep 28, 2009 at 16:53, Jae-Joon Lee lee.j.j...@gmail.com wrote: I personally think that a box, whose height has a physical meaning (in data coordinate) while its width does not, is not a good representation of your data. A vertical line or something like errorbar seems to be more

Re: [Matplotlib-users] Path object where different vertices use different transforms?

2009-09-28 Thread Jae-Joon Lee
Could you possibly explain exactly what is going on and how this structurally differs from the approach that Mike posted? In Mike's code, he uses BboxTransformTo using the box he created in display coords.  So this takes a unit square and spits out the box that I specify when I instantiate

Re: [Matplotlib-users] Path object where different vertices use different transforms?

2009-09-28 Thread Jae-Joon Lee
The exception will go away if you explicitly use np.array as below. box = np.array([[self.x, self.y1], [self.x, self.y2]]) However, note that Mike's example has x-center at 0. -JJ On Mon, Sep 28, 2009 at 6:41 PM, Uri Laserson laser...@mit.edu wrote: Hi Mike, This