SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Mark L. <lar...@gm...> - 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
From: John H. <jd...@gm...> - 2009年04月16日 18:21:56
On Thu, Apr 16, 2009 at 1:10 PM, Mark Larsen <lar...@gm...> 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
From: Mark L. <lar...@gm...> - 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 <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 <AREA> tag for each point
[/CODE]
I'd like to get information similar to this for the axis of the plot.
Thanks.
From: Mark L. <lar...@gm...> - 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 <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 <AREA> tag for each point
>
> [/CODE]
>
> I'd like to get information similar to this for the axis of the plot.
>
> Thanks.
>
From: Jae-Joon L. <lee...@gm...> - 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 <lar...@gm...> 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 <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 <AREA> 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Mark L. <lar...@gm...> - 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.
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /