## Re: [Matplotlib-users] Pixel Position of X/Y Axis

 Re: [Matplotlib-users] Pixel Position of X/Y Axis From: Mark Larsen - 2009-04-30 14:03:50 ```> You may use the bbox attribute of the axes. > For example,  ax.bbox.extents gives you the x,y coordinates of the > lowerleft and topright corners. Perfect, thanks so much. ```

 [Matplotlib-users] Pixel Position of X/Y Axis From: Mark Larsen - 2009-04-16 18:10:54 ```MPL Users, How can I get the matched max and min pixel/coordinate positions of my x and y axises? Thanks, LarsenMTL ```
 Re: [Matplotlib-users] Pixel Position of X/Y Axis From: John Hunter - 2009-04-16 18:21:56 Attachments: Message as HTML ```On Thu, Apr 16, 2009 at 1:10 PM, Mark Larsen wrote: > MPL Users, > > How can I get the matched max and min pixel/coordinate positions of my > x and y axises? I am not sure what you are asking -- could you elaborate? JDH ```
 Re: [Matplotlib-users] Pixel Position of X/Y Axis From: Mark Larsen - 2009-04-16 19:20:29 ```> I am not sure what you are asking -- could you elaborate? Sorry. I use matplotlib to create PNGs graphics for display on a web-page. I want to make the plots zoom-able. I'll use javascript to capture the pixel positions of the user's selected zoom region on the PNG plot. I'll then translate this into the coordinate system on the plot and redraw it with a new x, y range. I'm having trouble translating the initial axises into the pixel positions (essentially where they are on the PNG image). For example, I use the following code to map point positions from the coordinate system to pixel positions. I use an img map to provide interaction with the actual lines. [CODE] lineObj = plt.plot(Xs,Ys,marker='o')[0] path, affine = lineObj._transformed_path.get_transformed_points_and_affine() path = affine.transform_path(path) for real,pixel in zip(lineObj.get_xydata(),path.vertices): ## write tag for each point [/CODE] I'd like to get information similar to this for the axis of the plot. Thanks. ```
 Re: [Matplotlib-users] Pixel Position of X/Y Axis From: Mark Larsen - 2009-04-29 20:06:24 ```It's been a while, please allow me to bump this... > Sorry.  I use matplotlib to create PNGs graphics for display on a > web-page.  I want to make the plots zoom-able.  I'll use javascript to > capture the pixel positions of the user's selected zoom region on the > PNG plot.  I'll then translate this into the coordinate system on the > plot and redraw it with a new x, y range.  I'm having trouble > translating the initial axises into the pixel positions (essentially > where they are on the PNG image). > > For example, I use the following code to map point positions from the > coordinate system to pixel positions.  I use an img map to > provide interaction with the actual lines. > > [CODE] > > lineObj = plt.plot(Xs,Ys,marker='o')[0] > path, affine = lineObj._transformed_path.get_transformed_points_and_affine() > path = affine.transform_path(path) > for real,pixel in zip(lineObj.get_xydata(),path.vertices): >  ## write tag  for each point > > [/CODE] > > I'd like to get information similar to this for the axis of the plot. > > Thanks. > ```
 Re: [Matplotlib-users] Pixel Position of X/Y Axis From: Jae-Joon Lee - 2009-04-30 02:04:37 ```You may use the bbox attribute of the axes. For example, ax.bbox.extents gives you the x,y coordinates of the lowerleft and topright corners. -JJ On Wed, Apr 29, 2009 at 4:06 PM, Mark Larsen wrote: > It's been a while, please allow me to bump this... > >> Sorry.  I use matplotlib to create PNGs graphics for display on a >> web-page.  I want to make the plots zoom-able.  I'll use javascript to >> capture the pixel positions of the user's selected zoom region on the >> PNG plot.  I'll then translate this into the coordinate system on the >> plot and redraw it with a new x, y range.  I'm having trouble >> translating the initial axises into the pixel positions (essentially >> where they are on the PNG image). >> >> For example, I use the following code to map point positions from the >> coordinate system to pixel positions.  I use an img map to >> provide interaction with the actual lines. >> >> [CODE] >> >> lineObj = plt.plot(Xs,Ys,marker='o')[0] >> path, affine = lineObj._transformed_path.get_transformed_points_and_affine() >> path = affine.transform_path(path) >> for real,pixel in zip(lineObj.get_xydata(),path.vertices): >>  ## write tag  for each point >> >> [/CODE] >> >> I'd like to get information similar to this for the axis of the plot. >> >> Thanks. >> > > ------------------------------------------------------------------------------ > Register Now & Save for Velocity, the Web Performance & Operations > Conference from O'Reilly Media. Velocity features a full day of > expert-led, hands-on workshops and two days of sessions from industry > leaders in dedicated Performance & Operations tracks. Use code vel09scf > and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > ```
 Re: [Matplotlib-users] Pixel Position of X/Y Axis From: Mark Larsen - 2009-04-30 14:03:50 ```> You may use the bbox attribute of the axes. > For example,  ax.bbox.extents gives you the x,y coordinates of the > lowerleft and topright corners. Perfect, thanks so much. ```