Graph: Apply Palette to Color Map
Apply specified palette to graph or image
1. palApply fname:=system.path.program$+"Palettes\RedWhiteBlue.pal"; 2. palApply igl:=[Graph2]Layer1 fname:=system.path.program$+"Palettes\blue.pal" flip:=1;
Please refer to the page for additional option switches when accessing the x-function from script
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.
/* This example shows how to apply color palette on a graph layer. The sample data is exe_path\Samples\Matrix Conversion and Gridding\XYZ Random Gaussian.dat 1. Load sample data. 2. Convert random XYZ data into matrix by TPS method. 3. Plot a contour. 4. Use another color map. */ // Get sample data fn$ = system.path.program$ + "Samples\Matrix Conversion and Gridding\XYZ Random Gaussian.dat"; pn$ = system.path.program$ + "Palettes\RedWhiteBlue.pal"; newbook; impASC fn$; // Random worksheet to matrix gridding xyz_tps 3 s:=0.05; // Plot a contour worksheet -p 226 contour; // Turn off speedmode speedmode sm:=0; // Apply color map palApply fname:=pn$
Keywords:color scale, color mapping