Re: [Matplotlib-users] keeping zoom...

2007-06-18 Thread fred
fred a écrit :

I get anoter issue now.

How can I know if the displayed image has been zoomed or not
(I mean not on testing xlim & ylim) ?

TIA

-- 
http://scipy.org/FredericPetit


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] keeping zoom...

2007-06-18 Thread fred
fred a écrit :
> Sorry for the noise.

Thanks anyway, Jouni, I fixed my issue thanks to you ;-)

You showed me that the get_?lim methods were right,
so I followed my feeling further.

Cheers,

-- 
http://scipy.org/FredericPetit


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] keeping zoom...

2007-06-18 Thread fred
fred a écrit :
> Maybe I'm doing something wrong ?
Yes :-)

You only need to set extent to the const xmin/xmax & ymin/ymax
and not those you get with get_xlim & get_ylim.

Sorry for the noise.

Cheers,

-- 
http://scipy.org/FredericPetit


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] keeping zoom...

2007-06-18 Thread fred
Jouni K. Seppänen a écrit :
> Try:
>
> imshow(rand(50,50))
> # zoom with mouse
> xlim=getp(gca(), 'xlim'); ylim = getp(gca(), 'ylim')
> imshow(rand(50,50))
> setp(gca(), 'xlim', xlim); setp(gca(), 'ylim', ylim)
>   
Well..., I forgot to mention something, sorry ;-)
I already apply this trick: I use get_{x,y}lim and set_{x,y}lim.
Which works almost fine.

In fact, I use a grid, which is defined by xmin, xmax, dx & ymin, ymax, dy.
I don't want do display on the axes the number of points, but the real world
axis dimension.

If xmin=ymin=0 and xmax=ymax=500 with dx=dy=1,
the trick does work fine.

Now, if I set xmax=ymax=1000 but dx=dy=2 (so I have the same number of 
points)
I have to use imshow extent option, because of the use of _xlim & _ylim.

Please see http://fredantispam.free.fr/a.png without extent option,
http://fredantispam.free.fr/b.png with extent option.

But in this case, after zoomed,

see http://fredantispam.free.fr/c.png

the trick does not work anymore: x & y limits are right,
but the whole data is displayed by imshow.

see http://fredantispam.free.fr/d.png.

Maybe I'm doing something wrong ?

TIA.


Cheers,

-- 
http://scipy.org/FredericPetit


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] keeping zoom...

2007-06-18 Thread Jouni K . Seppänen
fred <[EMAIL PROTECTED]> writes:

> imshow(rand(50,50))
> then zoom with the mouse and redo
> imshow(rand(50,50))
> the zoom factor is not kept, ie xrange/yrange are still (0,50).
>
> How can I keep the zoom factor ?

Try:

imshow(rand(50,50))
# zoom with mouse
xlim=getp(gca(), 'xlim'); ylim = getp(gca(), 'ylim')
imshow(rand(50,50))
setp(gca(), 'xlim', xlim); setp(gca(), 'ylim', ylim)

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] keeping zoom...

2007-06-18 Thread fred
Hi,

I want to keep the image zoomed to the same factor for all my images.

If I try

ipython -pylab
imshow(rand(50,50))

then zoom with the mouse and redo

imshow(rand(50,50))

the zoom factor is not kept, ie xrange/yrange are still (0,50).

How can I keep the zoom factor ?

TIA.


Cheers,

-- 
http://scipy.org/FredericPetit


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users