Re: [Matplotlib-users] How to find out the extend of the actual image in pixels

2010-09-30 Thread Benjamin Root
On Thu, Sep 30, 2010 at 3:28 AM, Alexander Dietz < alexanderdie...@googlemail.com> wrote: > Hi, > > On Wed, Sep 29, 2010 at 16:00, John Hunter wrote: > >> On Wed, Sep 29, 2010 at 8:50 AM, Alexander Dietz >> wrote: >> >> > print ax.transData.transform((10.0, 20.0)) >> > [ 576. 432.] >> >> >> Why

Re: [Matplotlib-users] How to find out the extend of the actual image in pixels

2010-09-30 Thread Alexander Dietz
Hi, On Wed, Sep 29, 2010 at 16:00, John Hunter wrote: > On Wed, Sep 29, 2010 at 8:50 AM, Alexander Dietz > wrote: > > > print ax.transData.transform((10.0, 20.0)) > > [ 576. 432.] > > > Why do you say it's wrong? Note that in mpl, (0,0) is (bottom left), > not (upper,left). So this is saying

Re: [Matplotlib-users] How to find out the extend of the actual image in pixels

2010-09-29 Thread Jae-Joon Lee
On Wed, Sep 29, 2010 at 11:12 PM, Jonathan Slavin wrote: > This is interesting.  It seems that the event.x, event.y values are for > the entire figure area rather than limited to the image.  Anyone know > how to get the image values instead? Typically, images in matplotlib are associated with "da

Re: [Matplotlib-users] How to find out the extend of the actual image in pixels

2010-09-29 Thread Joe Kington
If you're just looking for the dimensions of the overall figure in pixels, you can easily access them through other means. E.g: import matplotlib.pyplot as plt fig = plt.figure() _, _, width, height = fig.bbox.extents # <- Extent of the figure in pixels fig.savefig('temp.png', dpi=fig.dpi) # <- Be

Re: [Matplotlib-users] How to find out the extend of the actual image in pixels

2010-09-29 Thread Alexander Dietz
Hi, On Wed, Sep 29, 2010 at 16:00, John Hunter wrote: > On Wed, Sep 29, 2010 at 8:50 AM, Alexander Dietz > wrote: > > > print ax.transData.transform((10.0, 20.0)) > > [ 576. 432.] > > > Why do you say it's wrong? Note that in mpl, (0,0) is (bottom left), > not (upper,left). So this is saying

Re: [Matplotlib-users] How to find out the extend of the actual image in pixels

2010-09-29 Thread Jonathan Slavin
This is interesting. It seems that the event.x, event.y values are for the entire figure area rather than limited to the image. Anyone know how to get the image values instead? Also, I wonder how one might get the values of the pixels (i.e. image value) at the pixels that you click on. One more

Re: [Matplotlib-users] How to find out the extend of the actual image in pixels

2010-09-29 Thread John Hunter
On Wed, Sep 29, 2010 at 8:50 AM, Alexander Dietz wrote: > print ax.transData.transform((10.0, 20.0)) > [ 576.  432.] Why do you say it's wrong? Note that in mpl, (0,0) is (bottom left), not (upper,left). So this is saying that the yellow dot at 10,20 (data coords) is 576 pixels up from the bo

Re: [Matplotlib-users] How to find out the extend of the actual image in pixels

2010-09-29 Thread Alexander Dietz
Hi John, thanks for the reply, but I think your method is not working: On Wed, Sep 29, 2010 at 15:39, John Hunter wrote: > On Wed, Sep 29, 2010 at 4:44 AM, Alexander Dietz > wrote: > > > I would like to know how to find out the extend of the actual image in a > > plot, in units of pixels. > >

Re: [Matplotlib-users] How to find out the extend of the actual image in pixels

2010-09-29 Thread John Hunter
On Wed, Sep 29, 2010 at 4:44 AM, Alexander Dietz wrote: > I would like to know how to find out the extend of the actual image in a > plot, in units of pixels. > As example I have attached a plot which is essentially empty. The lower left > corner is indicated by a red dot - what pixel position do

[Matplotlib-users] How to find out the extend of the actual image in pixels

2010-09-29 Thread Alexander Dietz
Hi, I would like to know how to find out the extend of the actual image in a plot, in units of pixels. As example I have attached a plot which is essentially empty. The lower left corner is indicated by a red dot - what pixel position does this location have? When opening this image in e.g. kview