José Gómez-Dans wrote:
> Hi,
> Is there a simple way to come up with a random colourmap? I need to plot 
> discrete values, and I would like that the colours do not show a trend, to 
> easily distinguish them?

It might help if you described the application.  I am guessing that you 
have a small number of values (5? 10? 15?) and that using direct 
indexing with a ListedColormap will be the simplest way to get what you 
want.

I have recently made this easier in svn, as illustrated by the second 
panel in examples/colorbar_only.py, but this is not yet available in a 
released version of mpl.

A simpler use of a ListedColormap is given in examples/contourf_demo.py, 
in the last plot; this is the same in recent mpl releases as in svn.

> 
> I read the cookbook entry on "Doing your own colormap", but can't seem to 
> bring my mind into it!

Are you referring to this 
http://www.scipy.org/Cookbook/Matplotlib/ColormapTransformations
?

Eric

> 
> Cheers!
> Jose

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to