Graticule Object
The Graticule object contains the properties and methods for a graticule created in Surfer with the Shapes method AddGraticule.
Derived from: Layer object, which is derived from Shape object (All methods and properties of Layer and Shape apply to this object.)
The following table provides the properties of the Graticule object.
Property |
Description |
Returns/sets the size of the graticule crosses |
|
Returns the LineFormat object for the graticule lines or crosses |
|
Returns the FontFormat object for the graticule labels |
|
Returns the LabelFormat object for the graticule labels |
|
Returns/sets the opacity for the graticule |
|
Returns/sets the graticule style (none, lines, or crosses) |
|
Returns the LineFormat object for the graticule tick mark lines |
|
Returns/sets the units for the graticule and labels |
The following table provides the methods of the Graticule object.
Method |
Description |
Sets the label and tick mark frequency in the X or Y direction |
|
Sets the label location, orientation, placement, and offset |
|
Sets the display and length of graticule tick marks |
|
Specifies the origin X and Y coordinates |
|
Specifies the graticule X and Y spacing |
Example
The following script demonstrates how the Graticule object is used in reference to the MapFrame object. Note a map must be created before a graticule can be added.
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 contour map and assigns the map coordinate system to
'the variable named "MapFrame"
Set MapFrame = Shapes.AddContourMap(GridFileName:=SurferApp.Path+"\Samples\demogrid.grd")
'Declares ContourLayer as an object
Dim ContourLayer As Object
'Assigns the contour map properties to the variable named
'"ContourLayer"
Set ContourLayer = MapFrame.Overlays(1)
'Declares Graticule as an object
Dim Graticule As Object
'Adds a graticule to the map, MapFrame
Set Graticule = Shapes.AddGraticule(MapFrame)
End Sub