Customizing the colormap presets in Surfer

Colormaps are an important tool in illustrating complex scientific information.  Surfer comes with a variety of predefined colormaps including several rainbow, gradient, divergent, and discrete styles. If the predefined colormaps do not meet your needs, you can customize them or create brand new ones using the Colormap Editor.

 

This article covers the following topics:

Creating custom colormaps
Adding custom colormaps to the presets menu
Using old color scales
Applying Colormaps via Automation

Creating custom colormaps

The easiest way to create a custom colormap is to start with a similar pre-existing one.  To do this:

  1. Open the Colormap Editor
    • From a contour layer, click the Levels tab in the Properties window and then click the Custom colormap (...) button.
    • From a color relief layer, click the General tab in the Properties window and then click the Custom colormap (...) button.
  2. Click in the Presets field and select GrayScale or another colorscale that closely resembles the color distribution you're interested in.
  3. In the Color Mapping section,
    1. Click on the first color node.
    2. Click in the Color field and select the desired color for the lowest numeric value.
    3. Double click in the histogram to add a new node, if needed.
      1. Select the desired Color.
      2. Enter the Data Value or Position for the selected node, if needed.
    4. Adjust the Stretch and Method as desired.
    5. Click on the last color node
    6. Click in the Color field and select the desired color for the lowest numeric value.
  4. Click OK to apply the new colormap to your map

Adding custom colormaps to the presets menu

After creating a custom colormap, you may find you want to use that colormap in many other maps.  To do this you can save the colormap as a CLR file or you can add it to the preset menu in Surfer.  To add a custom colormap to the presets menu:

  1. Open the Colormap Editor and create or load your custom colormap.
  2. Click Add.
  3. To rename and rearrange custom presets:
    1. Click Edit to open the Edit Presets List dialog.
    2. Click and drag preset colormaps to reorganize the list.
    3. Click on a custom colormap and click Rename to open the Preset Name dialog.
    4. Enter the desired name and click OK.
    5. Click OK to close the Edit Presets List dialog.
  4. Click OK to close the Colormap Editor.

Using old color scales

The ColorScales folder found in the Surfer installation directory for Surfer 15 and earlier versions has been removed. One CLR file, Rainbow.clr, is copied to the Samples folder in the installation directory for your use.

If you want the older ColorScales folder, with all the additional CLR files, you can download the attached ColorScales.zip file. Just unzip the file and extract the folder to wherever you want the CLR files to be.

Once you have the old colormaps saved to your computer you can click Load in the Colormap Editor to apply them to your map.

 

Applying Colormaps via Automation

You can directly use any of the color scales contained within the Surfer colormap Presets list by calling them by name via automation. This is done using the LoadPreset method.

'Load a CLR file for the contour layer 
ContourLayer.FillForegroundColorMap.LoadPreset("Terrain")

 

If you are using a custom colormap that is not contained within the Surfer colormap Presets list, you can instead save the CLR file from the Colormap Editor to a location of your choice, then reference it by using the LoadFile method. The below example can be used where the (SurferApp.Path+"\Samples\Rainbow.clr") portion can be changed to your directory containing the desired CLR file. 

'Load a CLR file for the contour layer 
ContourLayer.FillForegroundColorMap.LoadFile(SurferApp.Path+"\Samples\Rainbow.clr")
'Applies the above fill settings to the layer
ContourLayer.ApplyFillToLevels(1, 1, 0)

 

Additional Resources:

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.