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")
 		Set LeftAxis = Axes("Left axis")
 		Set RightAxis = Axes("Right axis")
 		Set TopAxis = Axes("Top axis")
 
'Sets automatic scaling for the axis
		LeftAxis.AutoScale = True

'Lets you set custom scaling for an axis
		TopAxis.SetScale MajorInterval:= 0.5
		TopAxis.SetScale FirstMajorTick:= 1
		TopAxis.SetScale LastMajorTick:= 8
		TopAxis.SetScale Minimum:= 0.5
		TopAxis.SetScale Maximum:= 8.5
		TopAxis.SetScale Cross1:= 7.5

'Sets the title properties for the axis. See FontFormat object for all font options.
		TopAxis.Title = "Top Axis"
		LeftAxis.Title = "Transv. Dist. (m)"
		LeftAxis.TitleAngle = 270
		LeftAxis.TitleFont.Italic = True
		LeftAxis.TitleFont.Size = 16
		LeftAxis.TitleOffset1 = 2

'Sets the properties for the axis line. See LineFormat object for all line options.
		LeftAxis.AxisLine.ForeColorRGBA.Color = srfColorBlue
		LeftAxis.AxisLine.Width	= 0.03

'Sets major tick properites
		LeftAxis.MajorTickType = srfTickCross
		LeftAxis.MajorTickLength = 0.25

'Sets minor tick properties
		LeftAxis.MinorTickType = srfTickIn
		LeftAxis.MinorTickLength = 0.1
		LeftAxis.MinorTicksPerMajor	= 2

'Shows and formats the major grid lines. See LineFormat object for all line options.
		LeftAxis.ShowMajorGridLines	= True
		LeftAxis.MajorGridLine.ForeColorRGBA.Color = srfColorMagenta
		LeftAxis.MajorGridLine.Style = ".1 in. Dash"

'Sets the properties for the minor grid lines. See LineFormat object for all line options.
		LeftAxis.ShowMinorGridLines	= True
		LeftAxis.MinorGridLine.ForeColorRGBA.Color = srfColorGreen
		LeftAxis.MinorGridLine.Style = "Dash Dot Dot"

'Shows the axis tick labels
		LeftAxis.ShowLabels = True
		TopAxis.ShowLabels = True
		BottomAxis.ShowLabels = False

'Sets the label properties and font. See FontFormat object for all label font options.
		LeftAxis.LabelAngle = 315
		LeftAxis.LabelOffset = 0.2
		LeftAxis.LabelFont.Face = "Times New Roman"
		LeftAxis.LabelFont.ForeColorRGBA.Color = srfColorCyan
		LeftAxis.LabelFont.Size = 12

'Sets the label format. See LabelFormat object for all formatting options.
		LeftAxis.LabelFormat.Type=srfLabFixed
		LeftAxis.LabelFormat.NumDigits = 2

'Reverses the top axis (which automatically also reverses the parallel, bottom axis)
	TopAxis.Reverse = True

End Sub
