Colormaps with fixed mapping between scalar and RGB

Currently I am defining custom color maps following this guide. The problem I have is that the colors are scaled when the data range changes. Unless I am missing something.

I am trying to create a colormap like this one

In this map the mapping between scalar values and RGB is fixed and the colors should not change if I change the data range to, say, [0, 32]. In this example I would see only the three colors: light blue, green and pink.

The images are initially generated via a python script but the user can rescale the data range.

I guess I could add the RGB colors in the VTK file itself (legacy VTK), but I wonder whether there is a different, simpler approach.


Try setting Automatic Rescale Range to Never. This setting is at the top of the Color Map Editor. See more info in the docs:

1 Like

Automatic Rescale Range Mode is already set to never. However, if I rescale to data range it changes to Grow and update on 'Apply'. Not sure whether this is the expected behavior.

From the docs it seems that the default behavior should be modifiable from the Settings, but the option Never is not there.

I have also tried setting the transfer function update from the script with AutomaticRescaleRangeMode = "Never" and the results is the same.