Code covered by the BSD License  

Highlights from
Cubehelix Colormaps

5.0

5.0 | 1 rating Rate this file 49 Downloads (last 30 days) File Size: 7.36 KB File ID: #43700
image thumbnail

Cubehelix Colormaps

by

 

30 Sep 2013 (Updated )

Attractive full-color colormaps that also print in grayscale (keeping the sequence information).

| Watch this File

File Information
Description

Cubehelix are simply the best colormaps for published or distributed documents: they offer attractive color schemes for online and electronic documents (e.g. PDF), and yet when printed in grayscale they keep exactly the sequence information of the original data!

This package includes three Mfiles for working with Cubehelix colormaps:
- "cubehelix.m" returns a colormap created using Dave Green's Cubehelix colorscheme function.
- "cubehelix_view.m" creates an interactive figure for viewing Cubehelix colorschemes with real-time adjustment of the scheme's parameter values, plus a 'random' demonstration mode.
- "cubehelix_find.m" retrieves the Cubehelix parameter values from an existing colormap (i.e. the inverse of "cubehelix.m").

### Cubehelix ###

Cubehelix colorschemes consist of nodes along a tapered helix in the RGB color cube, with a continuous increase in perceived intensity (e.g. black->white). Thus the scheme defines attractive colormaps with a huge choice of hue, saturation and brightness, and yet printing a figure (or image) in Black-and-White (e.g. postscript) results in a monotonically increasing grayscale that retains the brightness order of the original colormap. The sequence information of the colormap is retained even in grayscale, which means an attractive colored image can be printed in grayscale and still be informative to the end-user.

The scheme is defined here: http://astron-soc.in/bulletin/11June/289392011.pdf
For more information and examples: http://www.mrao.cam.ac.uk/~dag/CUBEHELIX/

### Examples ###

% Interactive colorscheme parameter viewer:
cubehelix_view
% Set/reset the viewer with new parameter values:
cubehelix_view(0.5,-1.5,1,1)

% Plot a scheme's RGB values:
rgbplot(cubehelix(100))

% Plot a scheme in an RGB cube:
X = cubehelix(100,3,1.5,1,1);
axes('ColorOrder',X, 'NextPlot','replacechildren', 'View',[-40,40])
plot3(X(:,[1,1]).',X(:,[2,2]).',X(:,[3,3]).','.','MarkerSize',36)
grid on

% New colors for the "colormap" example:
load spine
image(X)
colormap(cubehelix)

% New colors for the "surf" example:
[X,Y,Z] = peaks(30);
surfc(X,Y,Z)
colormap(cubehelix([],0.5,-1.5,1,1,[0.29,0.92]))
axis([-3,3,-3,3,-10,5])

% Retrieve the Cubehelix parameters from an existing colormap:
map = cubehelix(10,1.4,-0.7,0.9,1.2);
cubehelix_find(map)
ans = [1.4,-0.7,0.9,1.2]

Acknowledgements

Light Bartlein Color Maps, Vivid Colormap, Cold Colormap, Red Blue Colormap, Haxby Color Map, Bipolar Colormap, Perceptually Improved Colormaps, Generate Maximally Perceptually Distinct Colors, Matlab Colormaps As Seen By Color Blind Users, Stoplight, Othercolor, Color Gradient: Generate Custom Linear Colormaps, Colormaps Compatible With Red Green Color Perception Deficiencies, Cbrewer : Colorbrewer Schemes For Matlab, Polarmap: Polarized Colormap, Build Custom Colormaps, Custom Colormap, Beautiful And Distinguishable Line Colors + Colormap, Color Brewer: Attractive And Distinctive Colormaps, Intuitive Rgb Color Values From Xkcd, and Rgbmap Color Maps inspired this file.

This file inspired Color Brewer: Attractive And Distinctive Colormaps, Name That Color! Rgb < > Colorname Converter, and Paruly.

Required Products MATLAB
MATLAB release MATLAB 7.11 (R2010b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
05 Aug 2014 John  
Updates
14 Oct 2013

- Add range sliders to viewer.
- Slightly robuster finder algorithm.
- Show some nice examples in the illustration!

13 Jan 2014

- Allow parameters to be input as a vector.
- Improve viewer background.
- Better demonstration-mode: random examples in the viewer.

17 Mar 2014

- Improve input argument checking.
- Viewer figure now displays warnings for clipped RGB or non-monotonic grayscale values.
- Demo now also varies the range values.

07 Aug 2014

- Improve input argument checking.

Contact us