seaborn.cubehelix_palette
- seaborn.cubehelix_palette(n_colors=6, start=0, rot=0.4, gamma=1.0, hue=0.8, light=0.85, dark=0.15, reverse=False, as_cmap=False)
Make a sequential palette from the cubehelix system.
This produces a colormap with linearly-decreasing (or increasing) brightness. That means that information will be preserved if printed to black and white or viewed by someone who is colorblind. “cubehelix” is also available as a matplotlib-based palette, but this function gives the user more control over the look of the palette and has a different set of defaults.
In addition to using this function, it is also possible to generate a
cubehelix palette generally in seaborn using a string starting with
ch: and containing other parameters (e.g. "ch:s=.25,r=-.5").
Number of colors in the palette.
The hue value at the start of the helix.
Rotations around the hue wheel over the range of the palette.
Nonlinearity to emphasize dark (gamma < 1) or light (gamma > 1) colors.
Saturation of the colors.
Intensity of the darkest color in the palette.
Intensity of the lightest color in the palette.
If True, the palette will go from dark to light.
If True, return a matplotlib.colors.ListedColormap.
list of RGB tuples or matplotlib.colors.ListedColormap
Green, D. A. (2011). “A colour scheme for the display of astronomical intensity images”. Bulletin of the Astromical Society of India, Vol. 39, p. 289-295.
Return a discrete palette with default parameters:
sns.cubehelix_palette()
Increase the number of colors:
sns.cubehelix_palette(8)
Return a continuous colormap rather than a discrete palette:
sns.cubehelix_palette(as_cmap=True)
Change the starting point of the helix:
sns.cubehelix_palette(start=2)
Change the amount of rotation in the helix:
sns.cubehelix_palette(rot=.2)
Rotate in the reverse direction:
sns.cubehelix_palette(rot=-.2)
Apply a nonlinearity to the luminance ramp:
sns.cubehelix_palette(gamma=.5)
Increase the saturation of the colors:
sns.cubehelix_palette(hue=1)
Change the luminance at the start and end points:
sns.cubehelix_palette(dark=.25, light=.75)
Reverse the direction of the luminance ramp:
sns.cubehelix_palette(reverse=True)