From: Stephen W. <ste...@cs...> - 2005-04-07 18:08:35
|
Hi, I was just comparing images displayed with imshow() with what I get from IRAF's display command and ds9. The latter puts the first axis increasing horizontally and the second axis increasing vertically, as if the image array were addressed as img[ix,iy], where ix and iy are integer x and y coordinates. The axes imshow() produces are labeled as if this is true for it as well, but in fact the image is upside down with respect to what I see with IRAF. Even odder, to see the same display I see in IRAF I have to do imshow(img[::-1,:]), as if I'm reversing the direction of the first axis. I've tried to look at the source, really, but I feel like I'm *years* away from being enough of a Python hacker to understand matplotlib. Steve |
From: Perry G. <pe...@st...> - 2005-04-07 18:12:31
|
check out the .matplotlibrc image.origin configuration parameter. The default is to have pixel 0,0 on the upper left which is opposite of what us weird astronomers think is the natural locationl Perry On Apr 7, 2005, at 2:08 PM, Stephen Walton wrote: > Hi, > > I was just comparing images displayed with imshow() with what I get > from IRAF's display command and ds9. The latter puts the first axis > increasing horizontally and the second axis increasing vertically, as > if the image array were addressed as img[ix,iy], where ix and iy are > integer x and y coordinates. The axes imshow() produces are labeled > as if this is true for it as well, but in fact the image is upside > down with respect to what I see with IRAF. Even odder, to see the > same display I see in IRAF I have to do imshow(img[::-1,:]), as if I'm > reversing the direction of the first axis. > > I've tried to look at the source, really, but I feel like I'm *years* > away from being enough of a Python hacker to understand matplotlib. > > Steve > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real > users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: John H. <jdh...@ac...> - 2005-04-07 18:15:06
|
>>>>> "Stephen" == Stephen Walton <ste...@cs...> writes: Stephen> Hi, I was just comparing images displayed with imshow() Stephen> with what I get from IRAF's display command and ds9. The Stephen> latter puts the first axis increasing horizontally and Stephen> the second axis increasing vertically, as if the image Stephen> array were addressed as img[ix,iy], where ix and iy are Stephen> integer x and y coordinates. The axes imshow() produces Stephen> are labeled as if this is true for it as well, but in Stephen> fact the image is upside down with respect to what I see Stephen> with IRAF. Even odder, to see the same display I see in Stephen> IRAF I have to do imshow(img[::-1,:]), as if I'm Stephen> reversing the direction of the first axis. Does changing the rc param image.origin : upper # lower | upper to lower help? Stephen> I've tried to look at the source, really, but I feel like Stephen> I'm *years* away from being enough of a Python hacker to Stephen> understand matplotlib. Hmm, the code's not that bad is it :-) JDH |
From: Stephen W. <ste...@cs...> - 2005-04-07 19:00:40
|
John Hunter wrote: >>>>>>"Stephen" == Stephen Walton <ste...@cs...> writes: >>>>>> >>>>>> >Does changing the rc param > > image.origin : upper # lower | upper > >to lower help? > > Yes, it makes the image the right way around. I was simply confused because I expected the pixel at (x,y) in the imshow display to be the value of img[x,y]. It appears not to be. I hasten to add MATLAB's worse, as the pixel at (x,y) is actually the value of img[y,x]; MATLAB displays with the first array coordinate increasing downward and the second from left to right. > Stephen> I've tried to look at the source, really, but I feel like > Stephen> I'm *years* away from being enough of a Python hacker to > Stephen> understand matplotlib. > >Hmm, the code's not that bad is it :-) > > I'm sure the code is fine, John, and it's just me. Specifically, if I want to see how matplotlib is doing something, I can't just trace function calls like I'm used to doing with Fortran and C, because there are methods too and I have to find the class which defines those methods to see what's happening. Is there anything like ctags for Python? Steve |
From: Robert K. <rk...@uc...> - 2005-04-07 21:35:24
|
Stephen Walton wrote: > I'm sure the code is fine, John, and it's just me. Specifically, if I > want to see how matplotlib is doing something, I can't just trace > function calls like I'm used to doing with Fortran and C, because there > are methods too and I have to find the class which defines those methods > to see what's happening. Is there anything like ctags for Python? Exuberant ctags http://ctags.sourceforge.net/ -- Robert Kern rk...@uc... "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter |
From: Stephen W. <ste...@cs...> - 2005-04-07 23:03:26
|
Robert Kern wrote: > Exuberant ctags > > http://ctags.sourceforge.net/ > Which, as it turns out, is the version of ctags on Fedora Core 3. I did a 'ctags -R' in the matplotlib root directory and am now happily browsing the source using nedit. Thanks, Robert! Steve |