imshow axis directions

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.

Does changing the rc param

  image.origin : upper # lower | upper

to lower help?

    > 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.

Hmm, the code's not that bad is it :slight_smile:

JDH

John Hunter wrote:

"Stephen" == Stephen Walton <stephen.walton@...267...> 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.

   > 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.

Hmm, the code's not that bad is it :slight_smile:

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

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
rkern@...376...

"In the fields of hell where the grass grows high
  Are the graves of dreams allowed to die."
   -- Richard Harter

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