All of the available axis properties can be reviewed in the Axis Object Help topic. A full sample script for this process is provided below.
Before you can change the settings of any individual axis, it must first be accessed through the Axes collection as shown below.
Dim Axes, XAxis As Object Set Axes = MapFrame.Axes 'Assigns the bottom X axis to the variable named "XAxis", instead of 1 you could use "bottom axis" Set XAxis = Axes(1) XAxis.Title = "X Axis Title"
To run this script:
- Copy the script below.
- In a Windows Explorer window, navigate to C:\Program Files\Golden Software\Surfer\Scripter.
- Double click on Scripter.exe to launch Scripter.
- Press Ctrl+A to select all of the existing lines then press Delete.
- Press Ctrl+V to paste the script into Scripter.
- Click Script | Run to run the script.
Sub Main Dim SurferApp As Object
Set SurferApp = CreateObject("Surfer.Application") SurferApp.Documents.Add(srfDocPlot) SurferApp.Visible = True Infile = SurferApp.Path + "\samples\demogrid.grd" Dim Plot, MapFrame, Axes, Axis As Object Set Plot = SurferApp.Documents.Add Set MapFrame = Plot.Shapes.AddContourMap(GridFileName:=Infile) Set Axes = MapFrame.Axes For Each Axis In Axes Axis.ShowLabels = False Axis.MajorTickType = srfTickNone Axis.MinorTickType = srfTickNone Next Axis End
See also the attached script, Axes.bas, which can also be found in the \Samples\Scripts\ folder in the Surfer installation directory.
Updated November 2021