Strip element STRIPELEMENT options

This page documents the configuration and behavior of strip elements.

STRIPELEMENT denotes an element whose concrete type is StripElement. Strip elements are the default element type of a stripchart widget:

stripchart .s
.s element create signal

The common element operations such as create, configure, activate, closest, bind, and delete are documented in ELEMENT.

Strip elements use the same underlying line-rendering machinery as line elements. Their data handling, axis mapping, pens, smoothing, symbols, error bars, value labels, weights, and styles therefore have the same semantics as described in LINEELEMENT.

Differences from line elements

A strip element exposes a restricted line-element option set intended for stripchart use.

In particular, the following LINEELEMENT options are not available for strip elements:

Option

Line-element feature

-areabackground

area-fill stipple background

-areaforeground

area-fill foreground

-areapattern

area filling with a solid or stipple pattern

-areaclose

area fill closure

-areaopacity

Cairo/SVG solid area fill opacity

-areatile

tiled area filling

-param

per-point parameter mapping returned by ELEMENT closest

-reduce

screen-space trace reduction

-state

line-element state option

-trace

filtering of increasing/decreasing X trace directions

All other options listed below use the same interpretation as the corresponding option on LINEELEMENT.

Data

Strip-element coordinates may be supplied with:

-x
-y
-xdata
-ydata
-data

For example:

.s element create signal -x {0 1 2 3 4} -y {1 4 2 5 3}

Rbc vector names may be used instead of literal coordinate lists:

vector create time voltage

time set    {0 1 2 3 4}
voltage set {1 4 2 5 3}

.s element create signal -x time -y voltage

The same transactional and left-to-right data-option semantics described for LINEELEMENT apply.

Non-finite data values and values outside the domain of a logarithmic axis form discontinuities in the rendered trace. Points on opposite sides of such a discontinuity are not connected.

Display decimation

Strip elements support -decimate none|auto with the same screen-density decimation semantics described for LINEELEMENT.

With -decimate auto, dense eligible strip data can be reduced before full world-to-screen mapping. The persistent data-domain cache supports monotonic X data, ranged Y updates, and pure tail growth of attached Rbc vectors.

This makes -decimate auto particularly suitable for continuously growing stripchart waveforms:

stripchart .s
vector create time voltage
.s element create signal -xdata time -ydata voltage -symbol none -showvalues no -smooth linear -decimate auto
time append $newTime
voltage append $newVoltage

If appended X values preserve the existing monotonic direction, only the newly exposed source data and affected cache summaries need to be examined. Shrinkage, non-monotonic growth, invalid data, or unknown source changes automatically fall back to the more general mapping path.

Decimation affects screen rendering only. PostScript output retains full source resolution.

Smoothing

Strip elements support the same smoothing modes as line elements:

linear
step
natural
cubic
quadratic
catrom

linear is the default.

Spline smoothing operates in mapped screen coordinates. Natural, quadratic, and Catmull-Rom smoothing require at least three mapped points.

As with line elements, spline smoothing never bridges a discontinuity. Each continuous run containing at least three mapped points is smoothed independently. Runs containing fewer than three mapped points remain ordinary linear trace segments.

Pens and symbols

Strip elements use line pens.

The built-in normal pen can be configured directly with options such as:

-color
-linewidth
-dashes
-offdash
-fill
-outline
-outlinewidth
-pixels
-symbol

A separately created line pen may be selected with -pen:

.s pen create tracePen -type line -color blue -linewidth 2
.s element configure signal -pen tracePen

-activepen selects the pen used when the element or individual data points are active.

See LINEELEMENT for detailed descriptions of line pens, symbols, symbol scaling, and symbol-density control.

Error bars of strip elements

Strip elements support the same symmetric and asymmetric error-bar data as line elements:

-xerror
-xlow
-xhigh
-yerror
-ylow
-yhigh

Their appearance is controlled by:

-showerrorbars
-errorbarcolor
-errorbarwidth
-errorbarcap

See LINEELEMENT for the complete error-bar semantics.

Value labels of strip elements

-valuecommand can replace the label text with a Tcl callback. See the custom value-label text section in LINEELEMENT for the callback arguments and error handling.

Strip elements can display coordinate values next to their data points using -showvalues.

Label appearance is controlled by:

-valueanchor
-valuecolor
-valuefont
-valuecommand
-valueoffset
-valueformat
-valuerotate
-valueshadow

See LINEELEMENT for value-selection and formatting behavior.

Weights and styles

-weights supplies a numeric weight for each data point and -styles maps weight ranges to named line pens.

The syntax and precedence rules are identical to those described for LINEELEMENT.

Strip element options

The complete strip-element option set is:

Option

Database name

Database class

Description

-activepen penName

activePen

ActivePen

Specifies the named line pen used when the element is active. An empty value disables the named active pen. The default is activeLine.

-bindtags tags

bindTags

BindTags

Specifies additional graph binding tags for the element. The default is all.

-color color

color

Color

Sets the built-in normal pen’s trace color. The default is navy blue.

-dashes dashes

dashes

Dashes

Sets the built-in normal pen’s trace dash pattern. An empty value selects a solid line. Each numeric list item accepts a Tcl integer expression.

-data data

data

Data

Supplies an even-length list of alternating X and Y values. Each literal list item accepts a Tcl numeric expression.

-decimate mode

decimate

Decimate

Selects automatic screen-density trace decimation. Accepted values are none and auto. The default is none. auto is applied only when the strip element and current display density are suitable.

-errorbarcap width

errorBarCap

ErrorBarCap

Sets the requested error-bar cap width. A positive value selects an explicit size; 0 automatically derives the size from the symbol size. The default is 1.

-errorbarcolor color

errorBarColor

ErrorBarColor

Sets the error-bar color. defcolor uses the trace color.

-errorbarwidth width

errorBarWidth

ErrorBarWidth

Sets the error-bar line width. The default is 1.

-fill color

fill

Fill

Sets the symbol fill color. defcolor uses the trace color; an empty value leaves symbols unfilled.

-hide boolean

hide

Hide

Controls whether the element is displayed. The default is no.

-hideplot boolean

hidePlot

HidePlot

Suppresses plotting of the element while keeping it in the display list and legend. A plot-hidden element does not contribute to automatic axis limits and is ignored by closest searches and element hit testing. The default is no.

-label text

label

Label

Sets the element label used by the legend. The initial label is the element name.

-labelrelief relief

labelRelief

LabelRelief

Sets the relief used for the element’s legend label. The default is flat.

-linewidth width

lineWidth

LineWidth

Sets the built-in normal pen’s trace width. The default is 1; 0 suppresses the trace.

-mapx axisName

mapX

MapX

Specifies the X axis used to map the element’s X coordinates. The axis must exist and must be an X axis. The default is x.

-mapy axisName

mapY

MapY

Specifies the Y axis used to map the element’s Y coordinates. The axis must exist and must be a Y axis. The default is y.

-maxsymbols number

maxSymbols

MaxSymbols

Requests a reduced symbol display density when the element contains many points. 0 draws symbols without this reduction. The default is 0.

-offdash color

offDash

OffDash

Sets the color used for the gaps of a dashed trace. An empty value leaves the gaps transparent; defcolor uses the trace color.

-outline color

outline

Outline

Sets the symbol outline color. defcolor uses the trace color.

-outlinewidth width

outlineWidth

OutlineWidth

Sets the non-negative width of symbol outlines. The default is 1.

-pen penName

pen

Pen

Specifies a named line pen containing the element’s normal drawing attributes. An empty value uses the element’s built-in pen.

-pixels size

pixels

Pixels

Sets the requested symbol size. The default is 0.125i.

-scalesymbols boolean

scaleSymbols

ScaleSymbols

Controls whether symbol sizes are automatically scaled as the axis ranges change. The default is yes.

-showerrorbars value

showErrorBars

ShowErrorBars

Selects which error bars are displayed: X, Y, both, or neither. The default is both.

-showvalues value

showValues

ShowValues

Selects which coordinate values are displayed next to data points. The default is no.

-smooth mode

smooth

Smooth

Selects line smoothing. Accepted modes are linear, step, natural, cubic, quadratic, and catrom. The default is linear.

-styles styles

styles

Styles

Specifies pens selected according to -weights. Each style is either penName or {penName min max}. Bare pen names receive successive implicit weight ranges. An empty value disables weight-selected styles.

-symbol symbol

symbol

Symbol

Sets the symbol drawn at data points. The default is circle.

-valueanchor anchor

valueAnchor

ValueAnchor

Sets the anchor used to position value labels relative to their data points. The default is s.

-valuecolor color

valueColor

ValueColor

Sets the color used to draw value labels.

-valuefont font

valueFont

ValueFont

Sets the font used to draw value labels.

-valuecommand cmd

valueCommand

ValueCommand

Formats value labels with a Tcl command prefix. The default is empty.

-valueoffset {dx dy}

valueOffset

ValueOffset

Moves the label anchor by signed integer pixels. Default: {0 0}.

-valueformat format

valueFormat

ValueFormat

Sets the printf-style format used for value labels. The default is %g.

-valuerotate degrees

valueRotate

ValueRotate

Sets the rotation angle of value labels in degrees. The default is 0.0.

-valueshadow shadow

valueShadow

ValueShadow

Specifies a shadow for value labels. An empty value disables the shadow.

-weights weights

weights

Weights

Supplies per-point numeric weights used to select pens through -styles. Each literal list item accepts a Tcl numeric expression.

-x data

xData

XData

Supplies the element’s X coordinates as a list or Rbc vector. Each literal list item accepts a Tcl numeric expression.

-xdata data

Synonym for -x.

-xerror data

xError

XError

Supplies symmetric X error magnitudes as a list or Rbc vector. Each literal list item accepts a Tcl numeric expression.

-xhigh data

xHigh

XHigh

Supplies the upper X error endpoints as a list or Rbc vector. Each literal list item accepts a Tcl numeric expression.

-xlow data

xLow

XLow

Supplies the lower X error endpoints as a list or Rbc vector. Each literal list item accepts a Tcl numeric expression.

-y data

yData

YData

Supplies the element’s Y coordinates as a list or Rbc vector. Each literal list item accepts a Tcl numeric expression.

-ydata data

Synonym for -y.

-yerror data

yError

YError

Supplies symmetric Y error magnitudes as a list or Rbc vector. Each literal list item accepts a Tcl numeric expression.

-yhigh data

yHigh

YHigh

Supplies the upper Y error endpoints as a list or Rbc vector. Each literal list item accepts a Tcl numeric expression.

-ylow data

yLow

YLow

Supplies the lower Y error endpoints as a list or Rbc vector. Each literal list item accepts a Tcl numeric expression.


Copyright (c) George Yashin