matshow example fails

If I run the script below (taken straight from
the docs except for the imports) the script fails
with a message that matshow does not return a tuple, which
appears true. Dropping the extra LHS variables allows the
script to run, but produces 4 separate figures.

Thanks,
Alan Isaac

···

============================================

from scipy import *
from pylab import *
def samplemat(dims):
    aa = zeros(dims)
    for i in range(min(dims)):
        aa[i,i] = i
    return aa

dimlist = [(12,12),(128,64),(64,512),(2048,256)]

for d in dimlist:
    fig, ax, im = matshow(samplemat(d))
show()

Alan G Isaac wrote:

If I run the script below (taken straight from the docs except for the imports) the script fails with a message that matshow does not return a tuple, which appears true. Dropping the extra LHS variables allows the script to run, but produces 4 separate figures.

Thanks, Alan Isaac

============================================

from scipy import * from pylab import * def samplemat(dims): aa = zeros(dims) for i in range(min(dims)): aa[i,i] = i return aa

dimlist = [(12,12),(128,64),(64,512),(2048,256)]

for d in dimlist:

THIS LINE:

    fig, ax, im = matshow(samplemat(d))

should be:

> fig, ax, im = matshow(samplemat(d),returnall=True)

show()

Cheers,

f

Yes, this works.
(And indeed is documented.)
Thank you,
Alan Isaac

···

On Fri, 24 Jun 2005, Fernando Perez apparently wrote:

fig, ax, im = matshow(samplemat(d),returnall=True)