How can I remove the tick marks from the axes in Surfer via 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 16.
  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
    Next Axis



Updated November 12, 2018

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


  • 0
    Kien Pham

    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)

    Edited by Kien Pham
  • 1
    Justine Carstairs

    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.