Autoscale AxesImage after using set_data()

I could not find such a method, nor any similar one: request_redraw() or *_redraw(). I grepped through the version 1.0.1 source code.

Christoph

···

On 08.02.2011 10:23, Thomas Lecocq wrote:

I would suggest calling requet_redraw() ...

Christoph,

this could work ;

img.set_extent([0,200,0,200])

HTH

Thom

···

Thomas Lecocq

Geologist
Ph.D.Student (Seismology)
Royal Observatory of Belgium


Date: Tue, 8 Feb 2011 12:56:21 +0100
From: usenet@…3432…
To: thlecocq@…1954…
CC: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] Autoscale AxesImage after using set_data()

On 08.02.2011 10:23, Thomas Lecocq wrote:

I would suggest calling requet_redraw() …

I could not find such a method, nor any similar one: request_redraw() or
*_redraw(). I grepped through the version 1.0.1 source code.

Christoph

Yes, this works. Thank you.

So now I use
ax.relim()
ax.autoscale_view()
img.set_extent([0, 200, 0, 200])

img.set_extent explicitely which requires knowing the exact limits, although I want to :autoscale_.

And I find the documentation of the 'extent' keyword for Axes.imshow() <http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.imshow&gt; not clear in this respect:

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

...whatever that exactly means :slight_smile:

Christoph

···

On 08.02.2011 13:01, Thomas Lecocq wrote:

this could work ;

img.set_extent([0,200,0,200])

From my point of view it is strange, that one has to call