Axis Object

An Axis object is an individual axis (right, left, top, bottom, X, Y, or Z). An Axis object is a single element of an Axes collection. Axis objects are predefined by Surfer, and cannot be created or destroyed. They can be shown, hidden, or modified, however.

Derived from: Shape object (All methods and properties of Shape apply to this object.)

The following table provides the properties of the Axis object.

Property

Description

AutoScale

Returns/sets the auto scale state.

AxisLine

Returns the axis line format object. It is a read-only property.

AxisPlane

Returns/sets the plane of the axis.

AxisType

Returns the axis type. It is a read-only property.

Cross1

Returns the axis crossing along the orthogonal axis (in map units). It is a read-only property.

Cross2

Returns the axis crossing along the orthogonal axis (in map units). It is a read-only property.

FirstMajorTick

Returns the value of the first major tick in map units. It is a read-only property.

LabelAngle

Returns/sets the label angle from the axis in degrees.

LabelFont

Returns the label font object. It is a read-only property.

LabelFormat

Returns the label format object. It is a read-only property.

LabelOffset

Returns/sets the label offset from the axis in page units.

LastMajorTick

Returns the value of the last major tick in map units. It is a read-only property.

MajorGridLine

Returns the major grid line format object. It is a read-only property.

MajorInterval

Returns the interval between major ticks in map units. It is a read-only property.

MajorTickLength

Returns/sets the major tick length in page units.

MajorTickType

Returns/sets the major tick type.

Maximum

Returns the axis maximum in map units. It is a read-only property.

Minimum

Returns the axis minimum in map units. It is a read-only property.

MinorGridLine

Returns the minor grid line format object. It is a read-only property.

MinorTickLength

Returns/sets the minor tick length in page units.

MinorTicksPerMajor

Returns/sets the number of minor ticks per major tick.

MinorTickType

Returns/sets the minor tick type.

Reverse

Returns/sets the reverse axis state.

ShowLabels

Returns/sets the show labels state.

ShowMajorGridLines

Returns/sets the show major grid lines state.

ShowMinorGridLines

Returns/sets the show minor grid lines state.

Title

Returns/sets the axis title.

TitleAngle

Returns/sets the title angle in degrees from the axis.

TitleFont

Returns the title font format object. It is a read-only property.

TitleOffset1

Returns/sets the title offset along the axis in page units.

TitleOffset2

Returns/sets the title offset perpendicular to the axis in page units.

The following table provides the methods of the Axis object.

Method

Description

SetScale

Sets the axis scaling.

Example

The following script demonstrates how the Axis object is used in reference to the Axes collection.

Sub Main

 

'Declares SurferApp as an object

Dim SurferApp As Object

 

'Creates an instance of the Surfer Application object and assigns

'it to the variable named "SurferApp"

 

Set SurferApp = CreateObject("Surfer.Application")

 

'Makes Surfer visible

SurferApp.Visible = True

 

'Declares Plot as an object

Dim Plot As Object

 

'Creates a plot document in Surfer and assigns it to the variable

'named "Plot"

Set Plot = SurferApp.Documents.Add(srfDocPlot)

 

'Declares Shapes as an object

Dim Shapes As Object

 

'Assigns the Shapes collection to the variable named "Shapes"

Set Shapes = Plot.Shapes

 

'Declares MapFrame as an object

Dim MapFrame As Object

 

'Creates a map and assigns it to the variable named "MapFrame"

Set MapFrame = Shapes.AddContourMap(SurferApp.Path+"\Samples\demogrid.grd")

 

'Declares Axes as an object

Dim Axes As Object

 

'Assigns the Axes collection to the variable named "Axes"

Set Axes = MapFrame.Axes

 

'Declares Axis as an object

Dim Axis As Object

 

'Assigns the bottom X axis to the variable named "Axis"

'Instead of 1 you could use "bottom axis"

Set Axis = Axes(1)

 

End Sub