NCL Website header
NCL Home > Documentation > Graphics > Resources

GraphicStyle (gs) Resources

gsClipOn
This resource controls whether primitives are clipped to the plot viewport. When set to the default value, True, any parts of the primitive drawn outside the viewport will not appear. If set to False these elements of the primitive will appear, except in the case of data primitives drawn using a MapTransformation or an IrregularTransformation. In these cases the data space is undefined outside the viewport boundary and therefore the location of the primitives cannot be determined.

Default: True

gsColors
Available in version 6.2.0 and later.

This resource allows you to set an array of fill or line color indexes for polygons or polyline segments being drawn on or attached to a plot via the gsSegments resource, so it should have the same size as gsSegments. If it contains fewer elements, then the values will be recycled as often as required to draw all segments.

Default: None

gsEdgeColor
This resource of type NhlTColorIndex specifies the color used for the edges of fill primitives associated with the GraphicStyle object.

Default: Foreground

gsEdgeDashPattern
This resource of type NhlTDashIndex specifies the dash pattern for the edges of fill primitives associated with the GraphicStyle object.

Default: 0

gsEdgeDashSegLenF
This resource specifies the length of each segment of the dash pattern used for the edges of fill primitives associated with the GraphicStyle object.

Default: .15

gsEdgeThicknessF
This resource specifies the thickness of the edges of fill primitives associated with the GraphicStyle object. The value acts as a multiplier of a (device-dependent) unit thickness.

Default: 1.0

gsEdgesOn
If this boolean resource is set True, fill primitives associated with the GraphicStyle object are rendered with a line drawn around all visible edges.

Default: False

gsFillBackgroundColor
This resource of type NhlTColorIndex sets the color used as the background of fill primitives associated with the GraphicStyle object.

Default: Transparent

gsFillColor
This resource of type NhlTColorIndex sets the color used for fill primitives associated with the GraphicStyle object.

Default: Foreground

gsFillDotSizeF
This resource sets a uniform dot size, in NDC units, for the stipple dot fill pattern. The default value of 0.0 causes the dots to be drawn as before, using a workstation dependent minimum dot size. A caveat is that individual dots are not clipped around the edges of fill areas; this becomes more noticeable as the dot size increases.

Default: 0.0

gsFillIndex
This resource of type NhlTFillIndex sets the fill pattern used for fill primitives associated with the GraphicStyle object.

Default: 0

gsFillLineThicknessF
This resource specifies the thickness of lines used within the fill patterns of fill primitives associated with the GraphicStyle object.

Default: 1.0

gsFillOpacityF
Available in version 6.1.0 and later.

Sets the opacity of filled polygons. Specify a floating-point value in the range of 0.0 (completely transparent) to 1.0 (fully opaque).

Default: 1.0

gsFillScaleF
This resource specifies the fill pattern scaling factor for fill primitives associated with the GraphicStyle object.

Default: 1.0

gsFont
This resource specifies the font used to render text primitives associated with the GraphicStyle object.

Default: pwritx

gsFontAspectF
This resource specifies the font aspect ratio for text primitives associated with the GraphicStyle object.

Default: 1.3125

gsFontColor
This resource of type NhlTColorIndex specifies the color of text primitives associated with the GraphicStyle object.

Default: Foreground

gsFontHeightF
This resource specifies the font height for text primitives associated with the GraphicStyle object.

Default: 0.015

gsFontOpacityF
Available in version 6.1.0 and later.

Sets the opacity of text drawn as graphics on a plot. Specify a floating-point value in the range of 0.0 (completely transparent) to 1.0 (fully opaque).

Default: 1.0

gsFontQuality
This resource of type NhlFontQuality determines the quality of the font used to render text primitives associated with the GraphicStyle object. There are three choices:
High
Draw characters using any of the stoked or filled fonts.
Medium
Draw characters using a 94-character stroked font that is simpler than the High quality fonts, resulting in somewhat smaller metafiles. The gsFont resource is ignored.
Low
The characters are output as a string into the metafile. The quality of the output therefore depends on the fonts available to the metafile translator. When NCAR Graphics translators are used, the font quality is similar to that of Medium text. The gsFont resource is ignored.

Default: High

gsFontThicknessF
This resource specifies the font thickness for text primitives associated with the GraphicStyle object. The value acts as a multiplier of a (device-dependent) unit thickness.

Default: 1.0

gsLineColor
This resource of type NhlTColorIndex specifies the color of line primitives associated with the GraphicStyle object.

Default: Foreground

gsLineDashPattern
This resource of type NhlTDashIndex specifies the dash pattern for line primitives associated with the GraphicStyle object.

Default: 0

gsLineDashSegLenF
This resource indicates the length of each segment of a dash pattern used for line primitives associated with the GraphicStyle object. It is the length in NDCs before the dash pattern repeats itself. If line labels are being drawn, this is also the length between the end of one label and the start of the next.

Default: 0.15

gsLineLabelConstantSpacingF
Normally when gsLineLabelFontQuality is set to High, line labels for line primitives associated with the GraphicStyle object are rendered using proportional spacing. Setting the gsLineLabelConstantSpacingF to a value greater than 0.0 overrides this behavior. Instead, the distance from the start of one character to the next is computed by multiplying a single standard character width by the value of gsLineLabelConstantSpacingF. When gsLineLabelConstantSpacingF has a value between 0.0 and 1.0, characters will overlap. A value of 1.0 implies, on average, no space between characters, while values increasing from 1.0 cause the space between characters to grow. This parameter is ignored when gsLineLabelFontQuality is not High. Values less than 0.0 result in an error and are replaced with the default value.

Default: 0.0

gsLineLabelFont
This resource of type NhlTFont specifies the line label font for line primitives associated with the GraphicStyle object.

Default: 0

gsLineLabelFontAspectF
This resource specifies the line label font aspect ratio for line primitives associated with the GraphicStyle object.

Default: 1.3125

gsLineLabelFontColor
This resource of type NhlTColorIndex specifies the line label color for line primitives associated with the GraphicStyle object.

Default: Foreground

gsLineLabelFontHeightF
This resource specifies the line label font height for line primitives associated with the GraphicStyle object.

Default: 0.0125

gsLineLabelFontQuality
This resource of type NhlTFontQuality specifies the quality of the line label font for line primitives associated with the GraphicStyle object.

Default: High

gsLineLabelFontThicknessF
This resource specifies the line label font thickness for line primitives associated with the GraphicStyle object. The value acts as a multiplier of a (device-dependent) unit thickness.

Default: 1.0

gsLineLabelFuncCode
This resource of type NhlTCharacter sets the line label function code used for line primitives associated with the GraphicStyle object.

Note: the default function code was a colon (:) in NCL Versions 6.0.0 and earlier.

Default: ~

gsLineLabelString
This resource specifies the string used as the line label for line primitives associated with the GraphicStyle object.

Default: <dynamic>

gsLineOpacityF
Available in version 6.1.0 and later.

Sets the opacity of polyline or polygon boundaries. Specify a floating-point value in the range of 0.0 (completely transparent) to 1.0 (fully opaque).

Default: 1.0

gsLineThicknessF
This resource specifies the thickness of line primitives associated with the GraphicStyle object. The value acts as a multiplier of a (device-dependent) unit thickness.

Default: 1.0

gsMarkerColor
This resource of type NhlTColorIndex specifies the color of marker primitives associated with the GraphicStyle object.

Default: Foreground

gsMarkerIndex
This resource of type NhlTMarkerIndex specifies the marker glyph for marker primitives associated with the GraphicStyle object.

Default: "asterisk"

gsMarkerOpacityF
Available in version 6.1.0 and later.

Sets the opacity of marker symbols. Specify a floating-point value in the range of 0.0 (completely transparent) to 1.0 (fully opaque).

Default: 1.0

gsMarkerSizeF
This resource specifies the NDC size of marker primitives associated with the GraphicStyle object.

Default: 0.007

gsMarkerThicknessF
This resource specifies the thickness of the lines used to render marker primitives associated with the GraphicStyle object. The value acts as a multiplier of a (device-dependent) unit thickness.

Default: 1.0

gsSegments
Available in version 6.2.0 and later.

This resource allows you specify an array of indexes into the X/Y point arrays to indicate the start of each new line or polygon segment. This allows you to treat multiple line or polygon segments as a single composite polyline or polygon. Using this resource can significantly speed up code that is adding thousands of segments to a plot. It is only available with polyline and polygon drawing codes like gsn_add_polyline, gsn_add_polygon, NhlDataPolyline, and NhlDataPolygon.

The gsColors allows you to specify an array of color indexes associated with each line or polygon segment in gsSegments.

Default: None

gsTextAngleF
This resource specifies the rotation angle around the justification point of text primitives associated with the GraphicStyle object.

Default: 0.0

gsTextConstantSpacingF
Normally when gsFontQuality is set to High, text primitives associated with the GraphicStyle object are rendered using proportional spacing. Setting the gsTextConstantSpacingF to a value greater than 0.0 overrides this behavior. Instead, the distance from the start of one character to the next is computed by multiplying a single standard character width by the value of gsTextConstantSpacingF. When gsTextConstantSpacingF has a value between 0.0 and 1.0, characters will overlap. A value of 1.0 implies, on average, no space between characters, while values increasing from 1.0 cause the space between characters to grow. This parameter is ignored when gsFontQuality is not High. Values less than 0.0 result in an error and are replaced with the default value.

Default: 0.0

gsTextDirection
This resource of type NhlTTextDirection specifies the direction of the text primitives associated with the GraphicStyle object. There are two choices:
Down
Each character is placed below the previous character in the text string.
Across
Each character is placed to the right of the previous character in the text string.
These descriptions apply before any rotation due to gsTextAngleF is applied to the text primitive.

Default: Across

gsTextFuncCode
This resource of type NhlTCharacter specifies the function code used for text primitives associated with the GraphicStyle object.

Note: the default function code was a colon (:) in NCL Versions 6.0.0 and earlier.

Default: ~

gsTextJustification
This resource of type NhlJustification sets the justification point for text primitives associated with the GraphicStyle object. The first part of the string should be set to the desired vertical justifcation ("top", "center", "bottom"), and the second part to the desired horizontal justification ("left", "center", "right").

Default: CenterCenter