Scripting > Plotting Basics


G2dLine Class

G2dLine methods are decribed below.

G2dLine Methods

 

Method

Returns

Description

areSymbolsAutoInterval()

0/1

Return whether the symbols for this line are placed at program-decided intervals

areSymbolsVisible()

0/1

Return whether this line draws its symbols

editLineProperties()

None

Method that allows the editing of line properties. This method displays a visible dialog for line editing.

getFillColor()

Color

Return the fill color for this line

getFillColorString()

string

Return the fill color for this line as a String

getFillPatternString()

string

Return the fill pattern for this line as a String

getFillTypeString()

string

Return the Fill type for this line as a String.

getFirstSymbolOffset()

integer

Return the offset for the first symbol for this line

getLineColor()

Color

Return the line color for this line

getLineColorString()

string

Return the line color for this line as a String

getLineStepStyleString()

string

Return the line step style for this line as a String

getLineStyleString()

string

Return the line style for this line as a string

getLineWidth()

floating-point

Return the Line Width of the line

getNumPoints()

integer

Returns the Number of Points that this line has

getSymbolFillColor()

Color

Return the symbol fill color for this line’s symbols

getSymbolFillColorString()

string

Return the symbol fill color for this line’s symbols as a String

getSymbolInterval()

integer

Return the interval of data points (>0) on which symbols are drawn.

getSymbolLineColor()

Color

Return the symbol line color for this line’s symbols

getSymbolLineColorString()

string

Return the symbol line color for this line’s symbols as a String

getSymbolSize()

floating-point

Return the symbol size for this line

getSymbolSkipCountl()

integer

Return the number of points skipped between symbols (same as getSymbolInterval() – 1)

getSymbolTypeString()

string

Return the symbol type for this line as a string

isLineVisible()

0/1

Return this line is drawn

setFillColor(string fillColor)

None

Set the fill color for this line

setFillPattern(string fillPattern)

None

Set the fill pattern for this line

setFillType(string fillType)

None

Set the Fill type for this line

setFirstSymbolOffset(integer offset)

None

Set the offset for first symbol for this line

setLineColor(string lineColor)

None

Set the line color for this line

setLineStepStyle(string stepStyle)

None

Set the line step style for this line

setLineStyle(string style)

None

Set the line style for this line

setLineVisible(0/1 state)

None

Set whether to draw this line

setLineWidth(floating-point width)

None

Set the width for this line

setSymbolFillColor(string symbolFillColor)

None

Set the symbol fill color for this line’s symbols

setSymbolInterval(integer interval)

None

Set the interval of data points (>0) on which symbols are drawn.

setSymbolLineColor(string symbolLineColor)

None

Set the symbol line color for this line’s symbols

setSymbolsAutoInterval(0/1 state)

None

Set whether to have the program decide the interval at which to draw symbols

setSymbolSize(floating-point size)

None

Set the symbol size for this line

setSymbolSkipCount(integer count)

None

Set the number of points skipped between symbols.

setSymbolsVisible(0/1 state)

None

Set whether to draw the symbols for this line

setSymbolType(string symbolType)

None

Set the symbol type for this line

 

The script in the example below creates a plot with a data set read from DSS, then tells that data set’s curve to draw its symbols auto skipped.

 

Example: Using G2dLine 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

stageCurve = thePlot.getCurve(stage)                                                  # get the stage curve

stageCurve.setSymbolsAutoInterval(TRUE)                                         # turn on symbols auto skip