On Tue, May 29, 2012 at 5:31 AM, Yasin Selçuk Berber <yasinberber@gmail.com> wrote:

Hi. I want to make sure how imshow shows a numpy array as image.
 
lets say below is our numpy data array where letter represent data values and numbers represent row/col indices.
 
  0 1 2
0 a b c
1 d e f
2 g h i
 
and lets think imshow's origin is default upper left. 
Now, if we show our data as an image, the orientation of visual representation of data shouldt change,
and seen like below, right?
 
  0 1 2
0 a b c
1 d e f
2 g h i
 
But if we pass origin="lower" keyword to imshow, (as in basemap by default);
is this what we expect to see ?
 
  0 1 2
2 g h i
1 d e f
0 a b c
 
To be clear, does imshow with "lower" keyword value;
 
1-takes first row of data and put it most bottom,
2-then take second row and put it one row upper from most bottom.....etc ?
 
Thanks.

--
Yasin Selçuk Berber
"Bismillah, her hayrın başıdır."


Hi Yasin,

Yes, your interpretation looks correct to me. Image coordinates typically have an origin at the upper left and increase downward and to the right. Setting `origin='lower' ` essentially changes `imshow` to use data coordinates, which typically have an origin at the bottom left and increase upward and to the right.

Do you expect (or get) something different?

Best,
-Tony