This article contains a sample script for turning the visibility of an axis off.
To run this script:
- Copy the script below, or download the attached BAS file: Visibility of Axis OFF.bas.
- 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.
- If you copied this script, press Ctrl+V to paste it into Scripter. If you downloaded it, click File | Open, select the BAS file from your downloads directory, and click Open.
- Click Script | Run to run the script.
'Visibility of Axis OFF.bas shows how to turn off the visibility of an axis. 'This is equivalent of unchecking the check box for the axis in the Object Manager. 'It does not turn off the tick marks, labels or axis titles (it just makes them invisible). 'To turn off the tick marks, labels and titles, please see HideAxes.bas. '================================ Sub Main 'Declare the variable that will reference the application Dim SurferApp As Object Set SurferApp = CreateObject("Surfer.Application") SurferApp.Visible = True 'Declares Plot as an object Dim Plot As Object Set Plot = SurferApp.Documents.Add 'Creates a contour map Dim MapFrame As Object Set MapFrame = Plot.Shapes.AddContourMap(GridFileName:=SurferApp.Path+"\samples\demogrid.grd") 'Assigns the Axes collection for the MapFrame to the variable named "Axes" Dim Axes As Object Set Axes = MapFrame.Axes 'Assigns the different axes to variable names Set BottomAxis = Axes("Bottom axis") BottomAxis.Visible=False End Sub
Updated February 13, 2017