I would like to know how to simply reverse the color order of a given colormap in order to use it with plot_surface.
By using invert_yaxis() method To invert Y-axis, we can use invert_yaxis() method. In the above example, we import the matplotlib. pyplot and numpy library.
Colormap. The new default colormap used by matplotlib. cm. ScalarMappable instances is 'viridis' (aka option D).
cmap stands for colormap and it's a colormap instance or registered colormap name (cmap will only work if c is an array of floats). Matplotlib colormaps are divided into the following categories: sequential, diverging, and qualitative.
The standard colormaps also all have reversed versions. They have the same names with _r
tacked on to the end. (Documentation here.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With