Saving just a colorbar

Hi,
I am using Matplotlib to produce colormaps which I use with other
programs. I would like to produce a PNG file with the used colormap
(so that I can overlay). Rather than doing an imshow(<something>)
followed by colorbar, is there an easy way I could pass the colorbar
my cmap instance to have it plotted on its own? In essence, what I
want to do is to do a savefig, and get something along the lines of
what is shown here: <http://www.igidl.ul.pt/colorscale.gif>. I will
need to change the scale (i.e., the numbers :D) with each run.

So far, I have "cut+pasted" from a whole image, which is hardly convenient! :frowning:

Cheers,
Jose

Jose,

Attached is an example that should at least point you in the right direction. I will also add it to the examples directory in the distribution.

Eric

Jose Gomez-Dans wrote:

colorbar_only.py (821 Bytes)

ยทยทยท

Hi,
I am using Matplotlib to produce colormaps which I use with other
programs. I would like to produce a PNG file with the used colormap
(so that I can overlay). Rather than doing an imshow(<something>)
followed by colorbar, is there an easy way I could pass the colorbar
my cmap instance to have it plotted on its own? In essence, what I
want to do is to do a savefig, and get something along the lines of
what is shown here: <http://www.igidl.ul.pt/colorscale.gif&gt;\. I will
need to change the scale (i.e., the numbers :D) with each run.

So far, I have "cut+pasted" from a whole image, which is hardly convenient! :frowning:

Cheers,
Jose