(Putting back on list)
Based on just a quick look, I'd make sure:
1) To set the x and y limits appropriately:
ax.set_xlim(0, nx)
ax.set_ylim(ny, 0)
2) Make sure to use the same colormapping limits, by using an instance
of normalize:
# Can also import Normalize from matplotlib.colors
norm = plt.Normalize(datamin, datamax)
ax.imshow(argW[0:ny/2+1, 0:nx/2+1], cmap_name, extent=(0,nx/2,ny/2,0),
norm=norm)
I'm pretty sure #1 is your problem in seeing, but #2 would potentially
cause a funky looking image.
Ryan
···
On Sun, Feb 28, 2010 at 12:24 PM, David Goldsmith <d_l_goldsmith@...9...> wrote:
--- On Sat, 2/27/10, Ryan May <rmay31@...287...> wrote:
From: Ryan May <rmay31@...287...>
Subject: Re: [Matplotlib-users] imshow size limitations?
To: "David Goldsmith" <d_l_goldsmith@...9...>
Cc: "matplotlib-users" <matplotlib-users@lists.sourceforge.net>
Date: Saturday, February 27, 2010, 7:58 PM
On Sat, Feb 27, 2010 at 2:23 PM, >> David Goldsmith >> <d_l_goldsmith@...9...> >> wrote:
> Question 2) is there some way I can add pieces of the
array incrementally to
> the image into their proper place, i.e., modify the
following code:
>
> ax.imshow(image[0:ny/2+1, 0:nx/2+1]) # upper
left corner of image
> ax.hold(True)
> ax.imshow(argW[ny/2+1:-1, 0:nx/2+1]) # lower
left corner of image
> ax.imshow(argW[0:ny/2+1, nx/2+1:-1]) # upper
right corner of image
> ax.imshow(argW[ny/2+1:-1, nx/2+1:-1]) # lower
right corner of imageTry the extents keyword argument. It let's you specify the
corners of
the image in data coordinates.Ryan
Hi, Ryan, thanks! Can you be a little more specific as to how I should try that? I tried:
ax.imshow(argW[0:ny/2+1, 0:nx/2+1], cmap_name, extent=(0,nx/2,ny/2,0))
ax.hold(True)
ax.imshow(argW[ny/2+1:-1, 0:nx/2+1], cmap_name, extent=(0,nx/2,ny,ny/2))
ax.imshow(argW[0:ny/2+1, nx/2+1:-1], cmap_name, extent=(nx/2,nx,ny/2,0))
ax.imshow(argW[ny/2+1:-1, nx/2+1:-1], cmap_name, extent=(nx/2,nx,ny,ny/2))which didn't work (I only got one "corner" - the last one, I think - i.e., I think it's still just putting subsequent images on top of prior ones).
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma