Colormap norming
See original GitHub issueColor mapping and scalar bar feature requests:
These requests stemmed from conversations with @prisae and @craigmillernz
Custom Colormaps
Can we implement a way for a user to make custom colormaps using matplotlib and send that map as the cmap argument? This should be as simple as adding in a type check and skipping over the colormap lookup code.
Update: implemented in #126
Categorical Colormaps
We also need a way to have categorical colormaps
Update: this is possible by using a custom built colormap from
matplotlib
norm option
Also, could we add a new norm keyword argument similar to matplotlib? See this page. This would help users apply a standard matplotlib norm or center a color mapping around a value without changing the range. E.g “My data scale goes from -0.6 to 0.3 and I’d like the red/blue color map to be centered so that white is at 0.”
@craigmillernz provided a super useful function for implementing this type of norm:
#Class to normalize colors to center around a value
from matplotlib.colors import Normalize
class MidpointNormalize(Normalize):
def __init__(self, vmin=None, vmax=None, midpoint=None, clip=False):
self.midpoint = midpoint
Normalize.__init__(self, vmin, vmax, clip)
def __call__(self, value, clip=None):
# I'm ignoring masked values and all kinds of edge cases to make a
# simple example...
x, y = [self.vmin, self.midpoint, self.vmax], [0, 0.5, 1]
return np.ma.masked_array(np.interp(value, x, y))
Interactive colormaps
Could we maybe make a tool to create custom colormaps? This honestly might make the most sense to create a totally separate module under @OpenGeoVis. I’m thinking some sort of ipywidget or PyQt5 type interface where a user can harness to create a custom colormap. If we can get this going, then provide a way for it to like with vtki and update the mappers so a user can interactively update the rendering scene while changing the colormap.
Here is an example from @prisae in MatLab:

Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (5 by maintainers)

Top Related StackOverflow Question
LogNormandSymLogNormAnother point (along comments by @craigmillernz): Adding the possibility for
LogNormandSymLogNorm(as in matplotlib/discretize).Thanks for opening the issue. As I mentioned on Slack, the idea arose because you mentioned the
interactivekeyword, which I meant was about changing the colormap, but turned out to be about changing the appearance/location of the colorbar. Again as I said before, I think in general this is a bad idea (at least for static figures, for the exactly same reasons whyjetetc are bad colormaps), but it can be very useful to explore the dataspace interactively.