The StreamlinePlot class represents a vector field by drawing streamlines.
Header file: ncarg/hlu/StreamlinePlot.h Class name: streamlinePlotClass Class pointer: NhlstreamlinePlotClass Fortran class function: NHLFSTREAMLINEPLOTCLASS Superclass: DataComm Composite classes: LogLinTransformation,IrregularTransformation,PlotManager Data specific class Class name: streamlinePlotDataDepClass Class pointer: NhlstreamlinePlotDataDepClass Fortran class function: NHLFSTREAMLINEPLOTDATADEPCLASS Superclass: DataSpec
+---------------------------------------------------------------+ | StreamlinePlot Resource Set | |---------------------------------------------------------------| | NAME TYPE ACCESS | | CLASS DEFAULT | |===============================================================| | stVectorFieldData NhlTInteger RCSG | | StVectorFieldData <none> | |---------------------------------------------------------------| | stStreamlineDrawOrder NhlTDrawOrder RCSG | | StStreamlineDrawOrder "Draw" | |---------------------------------------------------------------| | stMapDirection NhlTBoolean RCSG | | StMapDirection True | |---------------------------------------------------------------| | stStepSizeF NhlTFloat RCSG | | StStepSizeF <dynamic> | |---------------------------------------------------------------| | stMinLineSpacingF NhlTFloatGenArray RCSG | | StMinLineSpacingF <dynamic> | |---------------------------------------------------------------| | stMinStepFactorF NhlTFloatGenArray RCSG | | StMinStepFactorF 2.0 | |---------------------------------------------------------------| | stLengthCheckCount NhlTInteger RCSG | | StLengthCheckCount 35 | |---------------------------------------------------------------| | stCrossoverCheckCount NhlTInteger RCSG | | StCrossoverCheckCount -1 | |---------------------------------------------------------------| | stLineStartStride NhlTInteger RCSG | | StLineStartStride 2 | |---------------------------------------------------------------| | stArrowStride NhlTInteger RCSG | | StArrowStride 2 | |---------------------------------------------------------------| | stArrowLengthF NhlTFloat RCSG | | StArrowLengthF <dynamic> | |---------------------------------------------------------------| | stMinArrowSpacingF NhlTFloatGenArray RCSG | | StMinArrowSpacingF 0.0 | |---------------------------------------------------------------| | stLineThicknessF NhlTFloat RCSG | | LineThicknessF 1.0 | |---------------------------------------------------------------| | stLineColor NhlTInteger RCSG | | LineColor "Foreground" | |---------------------------------------------------------------| | stNoDataLabelOn NhlTBoolean RCSG | | AnnotationLabelsOn True | |---------------------------------------------------------------| | stNoDataLabelString NhlTString RCSG | | StNoDataLabelString <dynamic> | |---------------------------------------------------------------| | stZeroFLabelOn NhlTBoolean RCSG | | AnnotationLabelsOn True | |---------------------------------------------------------------| | stZeroFLabelString NhlTString RCSG | | StZeroFLabelString <dynamic> | |---------------------------------------------------------------| | stZeroFLabelFontHeightF NhlTFloat RCSG | | FontHeightF <dynamic> | |---------------------------------------------------------------| | stZeroFLabelTextDirection NhlTTextDirection RCSG | | TextDirection "Across" | |---------------------------------------------------------------| | stZeroFLabelFont NhlTFont RCSG | | Font "pwritx" | |---------------------------------------------------------------| | stZeroFLabelFontColor NhlTColorIndex RCSG | | FontColor "Foreground" | |---------------------------------------------------------------| | stZeroFLabelFontAspectF NhlTFloat RCSG | | FontAspectF 1.3125 | |---------------------------------------------------------------| | stZeroFLabelFontThicknessF NhlTFloat RCSG | | FontThicknessF 1.0 | |---------------------------------------------------------------| | stZeroFLabelFontQuality NhlTFontQuality RCSG | | FontQuality "High" | |---------------------------------------------------------------| | stZeroFLabelConstantSpacingF NhlTFloat RCSG | | TextConstantSpacingF 0.0 | |---------------------------------------------------------------| | stZeroFLabelAngleF NhlTFloat RCSG | | TextAngleF 0.0 | |---------------------------------------------------------------| | stZeroFLabelFuncCode NhlTCharacter RCSG | | TextFuncCode : | |---------------------------------------------------------------| | stZeroFLabelBackgroundColor NhlTColorIndex RCSG | | FillBackgroundColor "Background" | |---------------------------------------------------------------| | stZeroFLabelPerimOn NhlTBoolean RCSG | | EdgesOn True | |---------------------------------------------------------------| | stZeroFLabelPerimSpaceF NhlTFloat RCSG | | EdgeBorderWidthF 0.33 | |---------------------------------------------------------------| | stZeroFLabelPerimColor NhlTColorIndex RCSG | | EdgeColor "Foreground" | |---------------------------------------------------------------| | stZeroFLabelPerimThicknessF NhlTFloat RCSG | | EdgeThicknessF 1.0 | |---------------------------------------------------------------| | stZeroFLabelZone NhlTInteger RCSG | | StZeroFLabelZone 0 | |---------------------------------------------------------------| | stZeroFLabelSide NhlTPosition RCSG | | StZeroFLabelSide "Bottom" | |---------------------------------------------------------------| | stZeroFLabelJust NhlTJustification RCSG | | StZeroFLabelJust "CenterCenter" | |---------------------------------------------------------------| | stZeroFLabelParallelPosF NhlTFloat RCSG | | StZeroFLabelParallelPosF 0.0 | |---------------------------------------------------------------| | stZeroFLabelOrthogonalPosF NhlTFloat RCSG | | StZeroFLabelOrthogonalPosF 0.0 | +---------------------------------------------------------------+
You can access all LogLinTransformation resources. However, note that StreamlinePlot intercepts LogLinTransformation resources, as follows:
LogAxis
. If
trXAxisType is set to any other value, it sets
trXLog False.
LogAxis
. If
trYAxisType is set to any other value, it sets
trYLog False.
All Transformation superclass resources are accessible. However, StreamlinePlot blocks access to all resources specific to the IrregularTransformation except for:
In addition, StreamlinePlot intercepts these IrregularTransformation resources:NULL
and trXAxisType is set to any other
value than IrregularAxis
, StreamlinePlot
switches to a coordinate extent bounded by 0 and the length of the
X-Axis dimension minus one. If trXAxisType is not set, but
the LogLinTransformation resource trXLog is
set, StreamlinePlot sets trXAxisType to
LogAxis
if trXLog is True; if trXLog is
False, it changes trXAxisType to LinearAxis
if
it had been set to LogAxis
and leaves it unchanged
otherwise. trXAxisType can be set to LogAxis
without error only when the X-Axis coordinate extent as passed from
the VectorField is entirely positive. If this is not
the case, trXAxisType will default to LinearAxis
.
NULL
and trYAxisType is set to any other
value than IrregularAxis
, StreamlinePlot
switches to a coordinate extent bounded by 0 and the length of the
Y-Axis dimension minus one. If trYAxisType is not set, but
the LogLinTransformation resource trYLog is
set, StreamlinePlot sets trYAxisType to
LogAxis
if trYLog is True; if trYLog is
False, it changes trYAxisType to LinearAxis
if
it had been set to LogAxis
and leaves it unchanged
otherwise. trYAxisType can be set to LogAxis
without error only when the Y-Axis coordinate extent as passed from
the VectorField is entirely positive. If this is not
the case, trYAxisType will default to LinearAxis
.
Conditional
.
Conditional
.
The StreamlinePlot class provides a number of resources that you can use to influence the way the streamlines are generated and displayed.
StreamlinePlot instantiates child objects to manage transformations between the data coordinate system and NDC space. The LogLinTransformation manages linear and logarithmic transformations, and the IrregularTransformation manages the transformation if one or both axes are irregularly spaced. By default the data coordinate extents are based on the extents of the supplied VectorField object data, but you may adjust them using resources belonging to the transformation objects.
NULL
. The coordinate extents of a linear axis may
arbitrarily intersect or encompass the data extent. If you set a
logarithmic axis, then the coordinate extent of that axis must be
entirely positive, but otherwise may intersect or extend beyond the
data extent.
NULL
, then StreamlinePlot uses an
IrregularTransformation object. Note that
StreamlinePlot treats an axis with an associated
coordinate array as irregular even if the coordinate array actually
has evenly spaced values. StreamlinePlot represents an
irregular axis not by stretching and compressing various regions of the plot,
but by displaying it with irregularly spaced tick marks.
In addition to a small performance penalty, there are some
restrictions associated with use of the
IrregularTransformation object. Although you may
limit the coordinate extent to a subspace of the data coordinate
extent of the VectorField object data, you are not
allowed to define a coordinate range that extends outside the range of
the data coordinates of an irregular axis. Using the
IrregularTransformation resources trXAxisType or
trYAxisType,
it is possible to set an irregular axis to LinearAxis
or
even, under certain conditions, to LogAxis
, but the
results are probably not what you want. Since
StreamlinePlot does not intrinsically support a
linearization transformation for irregularly spaced data, it can only
switch to a linear system by replacing the data coordinates with array
index coordinates, which are, in fact, linearly spaced. To properly
transform irregularly spaced data into a linear or logarithmic
coordinate system, you must use the overlay mechanism (V4.1 Status Note 1).
In addition to the built-in transformation support, you can map a streamlineplot into a variety of other coordinate spaces by adding it as an overlay to a base plot. You can overlay a streamlineplot on a mapplot to transform the data into any of 10 different map projections. You can transform irregularly gridded vector data into a linear or logarithmic space by overlaying the streamlineplot on a loglinplot. You can also make a streamlineplot into an overlay of any other plot object, including a contourplot, an irregularplot, a vectorplot, or an xyplot. Use the NhlAddOverlay function to perform an overlay.
stStepSizeF specifies the basic step size (in NDC units) that StreamlinePlot uses to calculate the next point on the streamline. Although StreamlinePlot can usually be counted on to come up with a reasonable value for the step size based on the viewport and the size of the data grid, and although it performs some adaptive step sizing based on the field topology, you will find, in general, that setting a smaller step size will result in a more accurate plot. The drawback is that the streamlines will take a bit longer to generate.
stMinLineSpacingF specifies how close in NDC space streamlines are allowed to approach each other before being terminated. StreamlinePlot dynamically calculates a default value for this resource, again based on the viewport size and the number of elements in the data grid. As the value of this resource increases, the streamlines gradually disintegrate into a series of short disconnected lines. Smaller values result in a denser plot with fewer separate lines.
The stLineStartStride resource also affects the streamline density, but not in quite the same way as stMinLineSpacingF. It specifies at how many points within the data grid streamlines may be started. Streamlines always begin at the center of a 'grid box', that is, at a point in data space located equally distant from four points on the grid where vector data values are defined. If you set stLineStartStride to a value greater than 1, some of these potential starting points will not be considered eligible for starting a streamline. For instance, when stLineStartStride is set to its default value of 2, only every other grid box (along each data dimension) will be initially eligible. As the drawing operation progresses, many of these initially eligible boxes become ineligible when a streamline in progress passes through the area defined by the outline of the box.
You can control the directional arrow spacing in two different ways. The resource stArrowStride works in a similar manner to stLineStartStride. It specifies which data grid boxes are eligible for a directional arrow. For example, when stArrowStride has its default value, 2, every second grid box (along each dimension) is eligible for a directional arrow.
The stArrowStride resource works well unless a non-linear transformation is in effect. In such cases, as for instance in many map transformations, the arrows may be reasonably spaced in the lower latitudes, but become unacceptably crowded near the poles. The resource stMinArrowSpacingF was designed to help solve this problem. It allows a directional arrow to be drawn only if at least the NDC distance specified by its value has been added to the streamline since the previous directional arrow.
All the remaining resources for the zero field annotation have the prefix stZeroFLabel. These include a complete set of text attribute resources, as well as resources for controlling position according to the locational conventions of the PlotManager Location Control Model.
1. The support for irregular transformations is at a transistional stage. Eventually, StreamlinePlot will be able to perform transformations from irregular coordinates to linear and logarithmic coordinates without using the overlay mechanism. This will eliminate the need for a switch to the index coordinate system.
NG4.1 Home, Index, Examples, Glossary, Feedback, Ref Contents, Ref WhereAmI?