Skip to content

colormap

Get or set the colormap of the current figure.

colormap(name)
colormap(C)
C = colormap

Sets the colormap used for surface / image / scatter color encoding. name is a string like 'jet', 'parula', 'hot', 'cool', 'gray', 'viridis', etc.; C is an N × 3 matrix of RGB rows. Without argument, returns the current colormap.

colormap('parula')
colormap(jet(64))
  • caxis — Get or set color-axis limits.
  • colorbar — Add a color-scale legend to the figure.