Skip to content

Instantly share code, notes, and snippets.

View askorikov's full-sized avatar

Alexander Skorikov askorikov

  • CWI
  • Amsterdam
View GitHub Profile
@askorikov
askorikov / turbo.m
Created August 21, 2019 14:10
Google's Turbo colormap in Matlab
function map = turbo(m)
%TURBO Improved rainbow colormap for visualization.
% TURBO(M) returns an M-by-3 matrix containing a colormap.
% The colormap resembles JET, but is improved to reduce the unnatural
% sharp transitions between colors and be perceptually smooth. The colors
% begin with dark purple, range through shades of blue, cyan, green,
% yellow, red and end with dark red.
%
% TURBO returns a colormap with the same number of colors as the current
% figure's colormap. If no figure exists, MATLAB uses the length of the