Scripting > Plotting Basics


AxisTics Class

AxisTics methods are described below.

AxisTics Methods

Method

Returns

Description

areMajorTicLabelsVisible()

0/1

Return whether the major tic labels are visible.

areMajorTicsVisible()

0/1

Return whether the major tics are visible

areMinorTicLabelsVisible()

0/1

Return whether the minor tic labels are visible

areMinorTicsVisible()

0/1

Return whether the minor tics are visible

computeRatingFromOppositeAxis()

None

When used on the right (Y2) AxisTics object, with related curves on the Y1 and Y2 axes (e.g. stage and flow, or elevation and storage), causes the AxisTics to behave in a non-linear fashion such that Y1 and Y2 curves are coincident.

editProperties()

None

Display the Edit Properties Dialog for the AxisTics

getAxis()

Axis

Returns a reference to the axis that this object draws

getAxisTicColor()

Color

Return the tic color

getAxisTicColorString()

String

Return the tic color as a String

getFontSizes()

tuple of 3 integers

Return the regular, tiny, min and max font sizes for this AxisTics

getMajorTicLength()

Integer

Return the major tic length

getMinorTicLength()

integer

Return the minor tic length

setAxisTicColor(
   string colorString)

None

Set the tic color to the color represented by colorString

setFontSizes(integer sz,  
    integer tiny, integer min,
   integer max)

None

Set the regular, tiny, min and max font sizes for this AxisTics

setMajorTicLabelsVisible(
   0/1 state)

None

Set the visibility of the major tic labels

setMajorTicLength(
   int ticLength)

None

Set the major tic length

setMajorTicsVisible(0/1 state)

None

Set the visibility of the major tics

setMinorTicLabelsVisible(
   0/1 state)

None

Set the visibility of the minor tic labels.

setMinorTicLength(
   int ticLength)

None

Set the minor tic length

setMinorTicsVisible(0/1 state)

None

Set the visibility of the minor tics

 

The script in the example below creates a new Plot with a data set read from DSS and tells the data set’s axis tics to draw its minor tic marks.

 

Example: Using AxisTics Objects

from hec.script import *                                                                      # for Plot class

from hec.script.Constants import TRUE, FALSE

from hec.heclib.dss import *                                                                # for DSS class

thePlot = Plot.newPlot()                                                                       # create a Plot

dssFile = HecDss.open(“C:/mydb.dss”)                                                  # open the DSS file

flow = dssFile.get(“/BASIN/LOC/FLOW/01NOV2002/1HOUR/OBS/”)      # read a data set

thePlot.addData(flow)                                                                          # add the data set

thePlot.showPlot()                                                                               # show the plot

viewport0 = thePlot.getViewport(flow)                                                  # get the viewport for the #flow data set

yAxisTics = viewport0.getAxisTics("Y1")                                              # get the axis tics for the #Viewport

yAxisTics.setMinorTicsVisible(TRUE)                                                   # tell axis tics to show tics