matshow?

Why does pylab.matshow() create a new figure by default when no other
standard pylab function I know of does that? It seems very
inconsistent for no particular gain, since as always
figure();matshow(m) will achieve that result if that is what is
desired.

--bb

No: matshow has to create a figure with a non-standard size so that
the final figure has the same aspect ratio as the array being
displayed. If you call figure() first, the figure has already been
created.

The code:

    # Extract actual aspect ratio of array and make appropriately sized figure
    w,h = figaspect(arr)
    fig = figure(fignum,figsize=(w,h))

Cheers,

f

ยทยทยท

On 3/16/07, Bill Baxter <wbaxter@...287...> wrote:

Why does pylab.matshow() create a new figure by default when no other
standard pylab function I know of does that? It seems very
inconsistent for no particular gain, since as always
figure();matshow(m) will achieve that result if that is what is
desired.