mtuq.graphics.attrs.PyGMTUtilities.configure_colormap¶
- static PyGMTUtilities.configure_colormap(colormap)[source]¶
Adjusts the given colormap name for compatibility with PyGMT and matplotlib conventions.
Parameters
colormap
(str): The name of the colormap to be used. If the colormap name ends with ‘_r’, the colormap is reversed, and the ‘_r’ suffix is removed.Returns
colormap
(str),cmap_reverse_flag
(bool): A tuple containing the adjusted colormap name and a boolean indicating whether the colormap should be reversed.Note
The method accept only colormaps that are available in PyGMT. For a list of available colormaps,
Example
>>> colormap, reverse = PyGMTUtilities.configure_colormap('viridis_r') >>> print(colormap) viridis >>> print(reverse) True