Make Colormap Levels and Color Consistent in Multiple Layers

posted in: Graphing | 1

Sometimes user has multiple color map plot in multiple layers of one graph and wants them to have consistent look, e.g. same colormap levels and colors. A few lines of Labtalk Script will do the trick.

This blog demonstrate how to change z range of the colormap and load a different color palette for it and repeat the process for a specified layer or all layers.

Please download Multi_Layer_Colormap.zip and open the opj file in Origin. The graph has 10 layers of polar contour graph side by side. The z value range of the colormaps is from -0.043 to 0.043.

  1. With the graph window active, choose Window: Script Window menu to open the Script window.
  2. Copy and Paste the script below into the window. Highlight all lines and hit Enter key to execute it. The script will work on active layer, which is the top-left plot.

3. If you want to do it for layer 5 (the first plot on right side), copy the following code into Script window. Highlight it and press ENTER key. This layer -o 5 will execute the script in {} in 5th layer only.

4. If you want to do it for all layers, copy the following code into Script window. Highlight it and press ENTER key. This doc -e LW will loop through all layers in active graph window.

One Response

  1. Antoine

    Nice tutorial on how to use colormap levels and loop over layers.

    If the user isn’t into scripting, he can manually set all the levels for one graph, then right click and select Copy Format/All, then right click anywhere in the graph page and select Paste Format (Advanced) and apply to All Graph Layers.

Leave a Reply