
Contents |
Apply Palette to Color Map
Apply palette to the specified graph with an existing palette file
1. palApply fname:=system.path.program$+"Palettes\RedWhiteBlue.pal";
2. palApply igl:=[Graph2]Layer1 fname:=system.path.program$+"Palettes\blue.pal" flip:=1;
| Display Name | Variable Name | I/O and Type | Default Value | Description |
|---|---|---|---|---|
| Input Graph | igl |
Input GraphLayer | | Specifies the graph layer to which the palette is applied. |
| Palette File | fname |
Input string | | Specifies the path and file name of the palette file to be applied. |
| Stretch to Full Range | stretch |
Input int | | If this checkbox is checked, the colors in the palette will be repeated or skipped to n, where n is the number of color map levels in the input graph layer. If this checkbox is clear and n is less than 256, only the first n colors in the palette will be used. If the checkbox is clear and n is more than 256, the entire set of colors in the palette will be repeated as many times as needed. |
| Flip Palette | flip |
Input int | | Specifies whether or not to flip the order of colors in the palette when the palette is applied to the graph layer. |
| Apply Scope | scope |
Input int | | Specifies the graph that on the layer to apply palette.
Option list:
|
This function applies an existing palette (*.PAL) file to a given graph layer. Note that color map should be available in the input graph layer. Otherwise, this X-Function can not be. Generally speaking, color maps are present in graphs such as 3D Surface Plots, Contour Plots, Image Plots, and in 2D plots where a particular attribute such as symbol size has been color mapped to the data in a worksheet column.
A typical palette file has 256 colors. A number of built-in palettes are provided. You can find them under the \Palettes subfolder of the Origin program folder. To create or edit user-defined palettes, another X-Function palEdit can be used.
Suppose that Contour plot is in the active layer of the active graph window. You can apply the Rainbow palette to in with the following procedure
1. Select Graph: Apply Palette to Color Map... from the Origin menu.
2. Click the browse
button to the right of the Palette File textbox and select Rainbow.PAL under \Palettes subfolder of Origin program folder.
3. Click OK. The Rainbow palette will be applied to the Contour plot.
For more examples, please refer to XF Script Dialog (press F11).