Register_cmap() how to?

I actually tried as in file matplotlib/cm.py as follows:

def register_cmap(name=None, cmap=None, *, override_builtin=False):
    """
    Add a colormap to the set recognized by :func:`get_cmap`.

    Register a new colormap to be accessed by name ::

        LinearSegmentedColormap('swirly', data, lut)
        register_cmap(cmap=swirly_cmap)

in my case:

turbo_camp=LinearSegmentedColormap.from_list(name='turbo', colors=turbo_colormap_data)
plt.register_cmap(cmap=turbo_camp)

but failed with the following message:

Exception has occurred: ValueError
Trying to re-register the builtin cmap 'turbo'.
  File "....../predict.py", line 87, in <module>
    plt.register_cmap(cmap=turbo_camp)

Any suggestions?

Pei

Turbo is already a colormap. If you want to change it, name your colormap turbo2 or similar.