Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reverse colormap in matplotlib

I would like to know how to simply reverse the color order of a given colormap in order to use it with plot_surface.

like image 375
Mermoz Avatar asked Jul 19 '10 08:07

Mermoz


People also ask

How do I flip Y axis in Matplotlib?

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.

What is Matplotlib default colormap?

Colormap. The new default colormap used by matplotlib. cm. ScalarMappable instances is 'viridis' (aka option D).

What is Matplotlib colormap?

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.


1 Answers

The standard colormaps also all have reversed versions. They have the same names with _r tacked on to the end. (Documentation here.)

like image 90
ptomato Avatar answered Oct 19 '22 05:10

ptomato