Colormaps

Colormaps

This package provides some pre-defined colormaps (described below). There are also several other packages which provide colormaps:

Predefined sequential and diverging colormaps

colormap(cname::String [, N::Int=100; mid=0.5, logscale=false, kvs...])

Returns a predefined sequential or diverging colormap computed using the algorithm by Wijffelaars, M., et al. (2008).

The optional arguments are:

Colormaps computed by this algorithm are guaranteed to have an increasing perceived depth or saturation making them ideal for data visualization. This also means that they are (in most cases) color-blind friendly and suitable for black-and-white printing.

The currently supported colormap names are:

Sequential

NameExample
BluesBlues
GreensGreens
Grays
OrangesOranges
PurplesPurples
RedsReds

Diverging

NameExample
RdBu (from red to blue)RdBu
Colors.colormapFunction.
colormap(cname, [N; mid, logscale, kvs...])

Returns a predefined sequential or diverging colormap computed using the algorithm by Wijffelaars, M., et al. (2008). Sequential colormaps cname choices are Blues, Greens, Grays, Oranges, Purples, and Reds. Diverging colormap choices are RdBu. Optionally, you can specify the number of colors N (default 100). Keyword arguments include the position of the middle point mid (default 0.5) and the possibility to switch to log scaling with logscale (default false).

source

Sequential and diverging color palettes

You can create your own color palettes by using sequential_palette():

sequential_palette(h, [N::Int=100; c=0.88, s=0.6, b=0.75, w=0.15, d=0.0, wcolor=RGB(1,1,0), dcolor=RGB(0,0,1), logscale=false])

which creates a sequential map for a hue h (defined in LCHuv space).

Other possible parameters that you can fine tune are:

Two sequential maps can also be combined into a diverging colormap by using:

diverging_palette(h1, h2 [, N::Int=100; mid=0.5,c=0.88, s=0.6, b=0.75, w=0.15, d1=0.0, d2=0.0, wcolor=RGB(1,1,0), dcolor1=RGB(1,0,0), dcolor2=RGB(0,0,1), logscale=false])

where the arguments are:

and the optional arguments are:

sequential_palette
diverging_palette