Setting the axis of an imshow plot

Actually, with xticklabels/yticklabels the zoom functionality for the
image is broken, so I still need a better solution.

···

On Mon, Nov 3, 2008 at 9:08 PM, Edin Salkovic <edin.salkovic@...287...> wrote:

On Mon, Nov 3, 2008 at 8:23 PM, Edin Salkovic <edin.salkovic@...287...> wrote:

Am I missing something obvious?

xticklabels/yticklabels did the job.

Sorry for the noise.

Edin Salkovic wrote:

Am I missing something obvious?

xticklabels/yticklabels did the job.

Sorry for the noise.

Actually, with xticklabels/yticklabels the zoom functionality for the
image is broken, so I still need a better solution.

Try the extent kwarg for imshow:

      *extent*: [ None | scalars (left, right, bottom, top) ]
        Eata values of the axes. The default assigns zero-based row,
        column indices to the *x*, *y* centers of the pixels.

So you would do:

imshow(data, extent=(l, r, b, t))

Ryan

···

On Mon, Nov 3, 2008 at 9:08 PM, Edin Salkovic <edin.salkovic@...287...> wrote:

On Mon, Nov 3, 2008 at 8:23 PM, Edin Salkovic <edin.salkovic@...287...> wrote:

--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

Yes, this works, thanks! The weird thing is that the first time I
tried "extent" it didn't work (i.e. I messed up something :slight_smile: ).

Edin

···

On Mon, Nov 3, 2008 at 10:47 PM, Ryan May <rmay31@...287...> wrote:

Try the extent kwarg for imshow:

     *extent*: [ None | scalars (left, right, bottom, top) ]
       Eata values of the axes. The default assigns zero-based row,
       column indices to the *x*, *y* centers of the pixels.

So you would do:

imshow(data, extent=(l, r, b, t))