How can I change post map labels via Surfer Scripter?

To change post map labels, create the post map, assign it to the overlays collection and then you can change the post map label properties. For more information, please see the PostLayer Object Help topic. 


For example:

Set MapFrame = Plot.Shapes.AddPostMap(SurferApp.Path+"\samples\demogrid.dat", LabCol:=3)
Dim PostLayer As Object
Set PostLayer = MapFrame.Overlays(1)

'Sets the label format properties. For all options, see LabelFormat object.
PostLayer.LabelFormat.NumDigits = 1
PostLayer.LabelFormat.Type = srfLabFixed

'Sets the label font properties. For all optiosn, see FontFormat object.
PostLayer.LabelFont.Face = "Comic Sans MS"
PostLayer.LabelFont.Size = 14
PostLayer.LabelFont.ForeColorRGBA.Color = srfColorBlue
PostLayer.LabelFont.Bold = True

'Sets the angle for the label text
PostLayer.LabelAngle = 30

'Sets the label position relative to the symbol
PostLayer.LabelPos = srfPostPosUser
PostLayer.LabelPos = srfPostPosUser

'Sets the X and Y offset for custom label positions relative to the symbol. This is only active if the LabelPos above is set to User (User Defined).
PostLayer.LabelXOffset = 0.02
PostLayer.LabelYOffset = 0.01

'Sets the 3D label line properties. See LineFormat object for all line property options.
PostLayer.LabelLine.ForeColorRGBA.Color = srfColorGreen

'Sets the length of the 3D label lines
PostLayer.LabelLineLength = 0.5

'Sets the plane for the labels
PostLayer.LabelPlane = srfPostScreen


See also the attached script PostMap.bas, which can also be found in the \Samples\Scripts\ folder in the Surfer installation directory.


Updated November 1, 2018

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


Please sign in to leave a comment.