Synopsis
Load the Cube Helix colormap into ChIPS
Syntax
import chips_contrib.helix as helix helix.load_colormap_cubehelix() helix.get_cubehelix()
Description
This module provides routines to create a Cube Helix colormap, usable in ChIPS. These color maps are designed to produce a set of colors with monotonically-increasing brightness, both on screen and when printed on a grayscale printer.
Loading the routines
The module can be loaded into ChIPS, Sherpa or Python scripts by saying:
import chips_contrib.helix as helix
Contents
This module currenly provides two routines: load_colormap_cubehelix and get_cubehelix.
Routine | Overview |
---|---|
load_colormap_cubehelix | Load the Cube Helix colors cheme into the ChIPS colormap slot (one of chips_usercmap1, chips_usercmap2, or chips_usercmap3). If not given, defaults to chips_usercmap1. |
get_cubehelix | Returns the red, green, and blue components for the Cube Helix color scheme (values are int he range 0 to 1, inclusive). |
Use the Python help system for more information on these commands:
chips> help(helix.load_colormap_cubehelix)
Examples
Example 1
chips> import chips_contrib.helix as helix chips> helix.load_colormap_cubehelix() chips> x = np.arange(-5, 5, 0.1) chips> xx, yy = np.meshgrid(x, x, sparse=True) chips> z = np.sin(xx**2 + yy**2) / (xx**2 + yy**2) chips> add_image(z, ['colormap', 'usercmap1']) chips> add_colorbar(0.5, 1.05) chips> hide_axis() chips> set_plot(['style', 'open'])
The load_colormap_cubehelix call sets up the chips_usercmap1 slot with a colormap created using the default cubehelix settings. This is then used to display the image.
Example 2
chips> (r, g, b) = helix.get_cubehelix() chips> x = np.arange(r.size) chips> set_preference('curve.symbol.style', 'none') chips> add_curve(x, r, ['*.color', 'red']) chips> add_curve(x, g, ['*.color', 'green']) chips> add_curve(x, b, ['*.color', 'blue']) chips> add_line(0, 0, r.size-1, 1) chips> set_axis(['pad', 0])
The red, green, and blue components for the default cubehelix color map are shown.
Changes in the scripts 4.6.3 (March2014) release
The start, hue, gamma, and nlev parameters were being ignored in both load_colormap_cubehelix() and get_cubehelix().
Changes in the scripts 4.6.1 (December 2013) release
The chips_contrib.helix module is new in this release.
About Contributed Software
This module is not an official part of the CIAO release but is made available as "contributed" software via the CIAO scripts page. Please see this page for installation instructions.
See Also
- contrib
- imextent
- images
- add_image, current_image, delete_image, display_image, get_image, hide_image, load_colormap, print_image, remove_image_channel, set_image, shuffle_image