Re: [Matplotlib-users] Pixel placement of text

2006-07-31 Thread John Hunter
> "Eric" == Eric Firing <[EMAIL PROTECTED]> writes: Eric> thread. I would like to remove it, together with Eric> copy_bbox_transform, on the grounds that these functions Eric> probably have not been used by anyone except during the last Eric> few days, and their functionality i

Re: [Matplotlib-users] Pixel placement of text

2006-07-31 Thread Eric Firing
Thanks to all who contributed to this thread concerning how to draw something such as text at an offset relative to a data point, with the offset in screen coordinates so that it stays constant with zooming etc. The result in svn is a new function in transforms: def offset_copy(trans, fig=None,

Re: [Matplotlib-users] Pixel placement of text

2006-07-29 Thread Jouni K Seppanen
[I'm Cc:ing people since the mailing list forwarder seems to be working really slowly.] Hi Bill, > You can even throw all the magic into one function like this: > > def const_offset(x,y): [...] > > And then just add a transform=const_offset(x,y) parameter wherever > you want one. This will

Re: [Matplotlib-users] Pixel placement of text

2006-07-29 Thread Bill Baxter
Hey that's great. Thanks Jouni. There may be a better way, but this is at least a lot easier to figure out than the code in QuiverKey! You can even throw all the magic into one function like this: def const_offset(x,y): ax = gca() ll1 = ax.transData.get_bbox1().ll() ur1 = ax.transData.

Re: [Matplotlib-users] Pixel placement of text

2006-07-28 Thread Eric Firing
John, Very good--I will work on it this weekend. Eric > Eric, how about adding a helper method to matplotlib.transforms call > "relative_to", something like > > trans = relative_to(artist, pointsx, pointsy) > > you can get dpi from artist.figure.dpi to construct the right > points->pixels o

Re: [Matplotlib-users] Pixel placement of text

2006-07-28 Thread John Hunter
> "Eric" == Eric Firing <[EMAIL PROTECTED]> writes: Eric> Attached is a simple example that illustrates the method. Eric> What threw me off last night is that the Eric> copy_bbox_transform() function was not doing what I Eric> expected. I don't know yet whether this is because

Re: [Matplotlib-users] Pixel placement of text

2006-07-28 Thread Eric Firing
Attached is a simple example that illustrates the method. What threw me off last night is that the copy_bbox_transform() function was not doing what I expected. I don't know yet whether this is because of a bug or a misunderstanding on my part, but in any case, the example provides an alter

Re: [Matplotlib-users] Pixel placement of text

2006-07-28 Thread John Hunter
> "Eric" == Eric Firing <[EMAIL PROTECTED]> writes: Eric> I think that what you want to do requires something like the Eric> mechanism in QuiverKey: a derived artist with a draw method Eric> that figures out at draw time where to put the text; I don't Eric> think there is any o

Re: [Matplotlib-users] Pixel placement of text

2006-07-28 Thread Eric Firing
Bill Baxter wrote: > Great. Thanks. I'll take a look at that file. Is "transFigure" the > one that I was calling "screen space"? All of the transforms go from some particular coordinate system to what one might call "screen coordinates": position in dots (pixels), with (0,0) in the lower left

Re: [Matplotlib-users] Pixel placement of text

2006-07-28 Thread Bill Baxter
Great. Thanks. I'll take a look at that file. Is "transFigure" the one that I was calling "screen space"? --bb On 7/28/06, Eric Firing <[EMAIL PROTECTED]> wrote: > Bill, > > You can see an example of how to do something similar by looking at the > QuiverKey class in quiver.py. It is all a mat

Re: [Matplotlib-users] Pixel placement of text

2006-07-28 Thread Eric Firing
Bill, You can see an example of how to do something similar by looking at the QuiverKey class in quiver.py. It is all a matter of using the transforms module. Eric Bill Baxter wrote: > I want to draw some labels with plot.text() and have them appear a > given number of pixels (or mm, or point

Re: [Matplotlib-users] Pixel placement of text

2006-07-28 Thread Bill Baxter
Howdy PGM, Thanks for the reply. On 7/28/06, PGM <[EMAIL PROTECTED]> wrote: > Bill, > Could you post an example of the problem ? I must admit I'm slower than usual > to react today, and I'm not sure I understand what you mean. > I tried that: > > plot([3,],[3,],'o') > gca().text(3,3,'TEXT') I'm p

Re: [Matplotlib-users] Pixel placement of text

2006-07-28 Thread Jouni K Seppanen
"Bill Baxter" <[EMAIL PROTECTED]> writes: > I want to draw some labels with plot.text() and have them appear a > given number of pixels (or mm, or points) to above and to the right of > the data points they are describing. Is there some way to specify a > screen offset from a point in graph coor