Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Jae-Joon Lee <lee.j.joon-Re5JQEeQqe8AvxtiuMwx3w <at> public.gmane.org>
Subject: Re: Looping through all the built-in colormaps
Newsgroups: gmane.comp.python.matplotlib.general
Date: Wednesday 24th February 2010 08:22:24 UTC (over 7 years ago)
On Tue, Feb 23, 2010 at 6:45 PM, David Goldsmith
 wrote:
> 1) why doesn't this:
>
>>>> for cmap in dir(cm):
>>>>    try:
>>>>        ax.imshow(image, cmap)
>>>>        canvas.print_figure('image_'+cmap)
>>>>    except:
>>>>        pass
>
> "work" (i.e., simply bypass those elements of dir(cm) which cause imshow
to raise an exception, but then continue on as if nothing had happened)?
 Is this a bug?
>

I believe this happens because you never clear your figure (or axes)
between print_figure.
imshow does not erase an existing image and you end up with bunch of
images overlapped.
And the exceptions are keep being raised as the image you created with
cmap="LUTSIZE" is still there.

calling ax.cla() before ax.imshow works for me.

Regards,

-JJ

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
CD: 3ms