Remove the tick marks from the axes via Surfer automation

Set the MajorTickType and/or MinorTickType to srfTickNone to not have the tick marks shown on the axis. Below is a full script demonstrating the use of this option.


To run this script:

  1. Copy the script below, or download the attached BAS file: RemoveAxisTicks.BAS
  2. In a Windows Explorer window, navigate to C:\Program Files\Golden Software\Surfer.
  3. Double click on Scripter.exe to launch Scripter.
  4. Press Ctrl+A to select all of the existing lines then press Delete.
  5. Press Ctrl+V to paste the script into Scripter. 
  6. Click Script | Run to run the script.


Sub Main
    Dim SurferApp, Plot, MapFrame, Axes, Axis As Object
    Set SurferApp = CreateObject("Surfer.Application")
    SurferApp.Visible = True
    Infile = SurferApp.Path + "\samples\demogrid.grd"
    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
End Sub


Updated November 2021

Was this article helpful?
4 out of 6 found this helpful


Date Votes
  • How do I access just the left axis?

    Nevermind, I figured it out. For those who are interested,

    Set Axes = MapFrame.Axes

    Set LeftAxis = Axes(3)

  • Hi Kien,

    Great, I'm glad you were able to get that working. Let us know if you have any further questions.

    Best wishes,

    Justine Carstairs


Please sign in to leave a comment.