[Matplotlib-users] Displaying raster colormap in a colorbar
ben.v.root at gmail.com
Fri Aug 3 17:26:14 EDT 2018
Off the top of my head, I wonder if you can set the colormap after the fact
on the image and then create the colorbar. The colorbar is going to assume
whatever colormap was set, and the default is viridis. The problem is that
I don't think a colormap is set on the image when RGB data is passed in
(so, it'll be None), which then means that colorbar falls back on the
default from the system, which is usually viridis. If you call
`im.set_cmap('NameOfYourColormap')`, and then call colorbar(), I think
On Fri, Aug 3, 2018 at 5:14 PM, Bruno Pagani <bruno.pagani at astrophysics.eu>
> Le 03/08/2018 à 23:09, Benjamin Root a écrit :
> > I think the issue is that the user is passing in an RGB array, but
> > wants a colormap that matches that array. That is a bit tricky. Do I
> > have my understanding correct?
> > Ben
> Exactly what I understood too. So do you have a solution for this? I’ve
> stackoverflow’d that question a bit, nothing cames out.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Matplotlib-users