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"
A full script example of this process is shown below.
To run this script:
- Copy the script below.
- In a Windows Explorer window, navigate to C:\Program Files\Golden Software\Surfer 14\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 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 February 14, 2017