x axis & imshow...

Hi All:

I’m working on a wxPython GUI that uses matplotlib.

This program reads “chunks” of a data file into
a numpy array and than plots it using imshow.

The first chunk works great. But, when I load chunks 2
to N, how can I specify the different values for the labels on the x axis?

I tried using “axes.set_xlim”. This did
reposition the x axis as hoped, but the data is always being drawn back at the “zero”
offset.

Is there a way to tell the axis to map the array to a
different x range?

I can’t read the whole file at once, it’s just
too big

THANXS

amb

Does the ‘extent’ keyword argument to imshow do what you want?

Ryan

···

On Fri, Feb 13, 2009 at 12:01 PM, Lewis, Ambrose J. <AMBROSE.J.LEWIS@…2441…> wrote:

Hi All:

I’m working on a wxPython GUI that uses matplotlib.

This program reads “chunks” of a data file into
a numpy array and than plots it using imshow.

The first chunk works great. But, when I load chunks 2
to N, how can I specify the different values for the labels on the x axis?

I tried using “axes.set_xlim”. This did
reposition the x axis as hoped, but the data is always being drawn back at the “zero”
offset.

Is there a way to tell the axis to map the array to a
different x range?

I can’t read the whole file at once, it’s just
too big


Ryan May
Graduate Research Assistant
School of Meteorology

University of Oklahoma
Sent from: Norman Oklahoma United States.

You can pass "extent=(left, right, bottom, top)" to imshow to specify what the pixels in the array correspond to in data space.

Mike

Lewis, Ambrose J. wrote:

···

Hi All:

I�m working on a wxPython GUI that uses matplotlib.

This program reads �chunks� of a data file into a numpy array and than plots it using imshow.

The first chunk works great. But, when I load chunks 2 to N, how can I specify the different values for the labels on the x axis?

I tried using �axes.set_xlim�. This did reposition the x axis as hoped, but the data is always being drawn back at the �zero� offset.

Is there a way to tell the axis to map the array to a different x range?

I can�t read the whole file at once, it�s just too big

THANXS

amb

------------------------------------------------------------------------

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA