|
From: Alan G I. <ai...@am...> - 2008-04-12 17:37:14
|
On Fri, 11 Apr 2008, Eric Firing apparently wrote:
> It sounds like what you want is a listed colormap with direct indexing
> using a NoNorm() instance as the norm:
> cmap = mpl.colors.ListedColormap(['k', 'r', 'b'])
> norm = mpl.colors.NoNorm()
> matshow(aa, cmap=cmap, norm=norm, interpolation='nearest')
Perfect!
I actually had found ListedColormap in the docs.
It's name was very promising but the __init__ function had
no help. Can I suggest adding at least the following:
`colors` is a sequence of Matplotlib colors.
`name` is a string (a name assigned to this colormap).
Seems obvious in retrospect, but of course that's too late ...
By the way, how is the name attribute used?
Thanks,
Alan
|