Modifying Axes

Axis settings may be changed using the Axis object. You access Axis objects through the Axes collection object, which in turn is accessed through a MapFrame object. The following example does not use subroutines, but you could write the script with subroutines instead.

Sub Main

' Start Surfer and create a blank plot document

Set SurferApp = CreateObject("Surfer.Application")

SurferApp.Visible = True

Set plot = SurferApp.Documents.Add(srfDocPlot)

 

' Create a contour map

gridfile$ = SurferApp.Path + \samples\demogrid.grd

Set mapframe = plot.Shapes.AddContourMap(gridfile$)

 

' Turn off screen redrawing to speed up this procedure

old_update_setting =

mapframe.Application.ScreenUpdating = False

 

' Adjust the left and bottom axes

For Each axis In mapframe.Axes

If axis.AxisType = SurferAppATLeft Or

With axis

.MajorTickType = SurferAppTickCross

.MinorTickType = SurferAppTickIn

.MinorTickLength = 0.1

.MinorTicksPerMajor = 9

.ShowMajorGridLines = True

.AxisLine.Width= 0.03

End With

End If

Next

 

' Restore the previous screen setting

mapframe.Application.ScreenUpdating =

End Sub

 

See Also

Automation Examples