::rbc

Commands

AXIS

A command ensemble.

AXIS subcommand ...

Description

The ensemble supports the following subcommands:

bind

Queries or modifies bindings associated with axis binding tags. With no arguments, returns the currently registered axis binding tags. With a tag name, returns the event sequences bound to that tag. With a sequence, returns its binding script. With a command, creates or replaces the binding.

cget

Queries the current value of an axis configuration option. See axis options for the complete option reference.

configure

Queries or modifies axis configuration. When querying, normally one axis name is supplied. When setting options, multiple axis names may precede the option/value pairs and the same configuration is applied to each named axis. See axis options for the complete option reference.

create

Creates a new virtual axis. The new axis is not displayed in a margin until it is assigned with a margin-axis use operation, although elements may be mapped to it while it remains virtual. Axis names must be unique within the graph and may not begin with -.

delete

Deletes one or more virtual axes. If an axis is still referenced by an element, physical destruction is deferred until the reference is released, but the deleted name immediately stops referring to that axis and may be reused for a newly created axis.

get

Gives back information about the axis currently selected by the graph binding machinery. current returns the axis name. detail returns label, title, or line depending on the part of the axis under the current binding position. If no axis is current, the result is empty.

invtransform

Converts an integer window coordinate to the corresponding graph value using the specified axis. The axis orientation and -descending setting are taken into account. Logarithmic axes return the corresponding positive data value.

limits

Gives back the effective displayed minimum and maximum of the specified axis. Automatic scaling, explicit limits, loose-range processing, and logarithmic mapping are reflected in the returned values. Logarithmic limits are returned as ordinary positive data values rather than base-10 exponents.

names

Gives back the names of existing axes. If one or more Tcl glob patterns are supplied, an axis is returned when its name matches any pattern. Axes pending deletion are not returned.

transform

Converts a graph value to an integer window coordinate using the specified axis. value is evaluated as a Tcl numeric expression and must be finite. Values transformed through a logarithmic axis must be positive.

view

Queries or changes the visible portion of an axis scrolling region. With no additional arguments, returns normalized first last fractions. moveto selects an absolute fraction. scroll moves by units or pages; a page is 90 percent of the current viewport. A single integer is accepted as a compatibility shorthand for scrolling that number of units.

Refer to the documentation of each subcommand for details.

AXIS bind

Queries or modifies bindings associated with axis binding tags. With no arguments, returns the currently registered axis binding tags. With a tag name, returns the event sequences bound to that tag. With a sequence, returns its binding script. With a command, creates or replaces the binding.

AXIS bind tagName
AXIS bind tagName sequence
AXIS bind tagName sequence command

Parameters

command:

Tcl script to execute for the binding.

sequence:

Tk event sequence.

tagName:

Axis name, axis class, or user-defined axis binding tag.

Return value

Binding tags, event sequences, or a binding script when querying; nothing when setting a binding.

AXIS cget

Queries the current value of an axis configuration option. See axis options for the complete option reference.

AXIS cget axisName option

Parameters

axisName:

Name of the axis.

option:

Axis configuration option.

Return value

Current value of option.

AXIS configure

Queries or modifies axis configuration. When querying, normally one axis name is supplied. When setting options, multiple axis names may precede the option/value pairs and the same configuration is applied to each named axis. See axis options for the complete option reference.

AXIS configure axisName
AXIS configure axisName option
AXIS configure axisName ?axisName ...? ?option value ...?

Parameters

axisName:

Name of an axis to query or configure.

option:

Axis configuration option.

value:

New value for the option.

Return value

Configuration information when querying; nothing when setting options.

AXIS create

Creates a new virtual axis. The new axis is not displayed in a margin until it is assigned with a margin-axis use operation, although elements may be mapped to it while it remains virtual. Axis names must be unique within the graph and may not begin with -.

AXIS create axisName ?option value ...?

Parameters

axisName:

Name of the new axis.

option:

Axis configuration option.

value:

Initial value for the option.

Return value

Name of the newly created axis.

AXIS delete

Deletes one or more virtual axes. If an axis is still referenced by an element, physical destruction is deferred until the reference is released, but the deleted name immediately stops referring to that axis and may be reused for a newly created axis.

AXIS delete ?axisName ...?

Parameters

axisName:

Name of an axis to delete.

Return value

Nothing.

AXIS get

Gives back information about the axis currently selected by the graph binding machinery. current returns the axis name. detail returns label, title, or line depending on the part of the axis under the current binding position. If no axis is current, the result is empty.

AXIS get name

Parameters

name:

Information to retrieve; must be current or detail.

Return value

Current axis name, current axis detail, or an empty result.

AXIS invtransform

Converts an integer window coordinate to the corresponding graph value using the specified axis. The axis orientation and -descending setting are taken into account. Logarithmic axes return the corresponding positive data value.

AXIS invtransform axisName value

Parameters

axisName:

Name of the axis used for the conversion.

value:

Integer window coordinate.

Return value

Corresponding graph-coordinate value.

AXIS limits

Gives back the effective displayed minimum and maximum of the specified axis. Automatic scaling, explicit limits, loose-range processing, and logarithmic mapping are reflected in the returned values. Logarithmic limits are returned as ordinary positive data values rather than base-10 exponents.

AXIS limits axisName

Parameters

axisName:

Name of the axis.

Return value

Two-element list min max.

AXIS names

Gives back the names of existing axes. If one or more Tcl glob patterns are supplied, an axis is returned when its name matches any pattern. Axes pending deletion are not returned.

AXIS names ?pattern ...?

Parameters

pattern:

Optional Tcl glob pattern used to select axis names.

Return value

List of matching axis names.

AXIS transform

Converts a graph value to an integer window coordinate using the specified axis. value is evaluated as a Tcl numeric expression and must be finite. Values transformed through a logarithmic axis must be positive.

AXIS transform axisName value

Parameters

axisName:

Name of the axis used for the conversion.

value:

Graph-coordinate value or Tcl numeric expression.

Return value

Corresponding integer window coordinate.

AXIS view

Queries or changes the visible portion of an axis scrolling region. With no additional arguments, returns normalized first last fractions. moveto selects an absolute fraction. scroll moves by units or pages; a page is 90 percent of the current viewport. A single integer is accepted as a compatibility shorthand for scrolling that number of units.

AXIS view axisName
AXIS view axisName moveto fraction
AXIS view axisName scroll number units
AXIS view axisName scroll number pages
AXIS view axisName number

Parameters

axisName:

Name of the axis.

fraction:

Normalized position used by moveto.

number:

Signed number of units or pages to scroll.

what:

Scrolling unit; must be units or pages.

Return value

Two-element list first last when querying; nothing when changing the view.

barchart

Creates a barchart widget. A barchart uses bar elements as its default element type. It uses the same graph widget infrastructure and common components as graph, but elements created through the generic GRAPHINST element interface are bar elements by default. Configuration options supplied when the widget is created are the same options accepted later by GRAPHINST configure.

barchart pathName ?option value ...?

Parameters

pathName:

Tk pathname of the barchart widget to create.

option:

Graph widget configuration option.

value:

Value for the configuration option.

Description

Example:

barchart .b -title "Example barchart" -width 800 -height 500
pack .b -fill both -expand yes

Return value

The pathname of the newly created barchart widget.

CROSSHAIRS

A command ensemble.

CROSSHAIRS subcommand ...

Description

The ensemble supports the following subcommands:

cget

Queries the current value of one crosshairs configuration option. See Crosshairs options.

configure

Queries or modifies crosshairs configuration options. With no arguments, returns all configuration information. With one option, returns information for that option. Otherwise args contains option/value pairs to change. See Crosshairs options.

off

Hides the crosshairs. This is equivalent to setting -hide yes. If the crosshairs are already hidden, the operation has no effect.

on

Enables the crosshairs by setting -hide no. The lines are drawn only when the configured position lies inside the plotting area; an empty or out-of-range position may therefore leave enabled crosshairs invisible.

toggle

Toggles crosshair visibility. Enabled crosshairs become hidden and hidden crosshairs become enabled. The resulting state is reflected by the -hide configuration option.

Refer to the documentation of each subcommand for details.

CROSSHAIRS cget

Queries the current value of one crosshairs configuration option. See Crosshairs options.

CROSSHAIRS cget option

Parameters

option:

Crosshairs configuration option.

Return value

Current value of the requested option.

CROSSHAIRS configure

Queries or modifies crosshairs configuration options. With no arguments, returns all configuration information. With one option, returns information for that option. Otherwise args contains option/value pairs to change. See Crosshairs options.

CROSSHAIRS configure ?option? ?value ...?

Parameters

option:

Crosshairs configuration option.

value:

New value for the option.

Return value

Configuration information when querying, otherwise nothing.

CROSSHAIRS off

Hides the crosshairs. This is equivalent to setting -hide yes. If the crosshairs are already hidden, the operation has no effect.

CROSSHAIRS off

Return value

Nothing.

CROSSHAIRS on

Enables the crosshairs by setting -hide no. The lines are drawn only when the configured position lies inside the plotting area; an empty or out-of-range position may therefore leave enabled crosshairs invisible.

CROSSHAIRS on

Return value

Nothing.

CROSSHAIRS toggle

Toggles crosshair visibility. Enabled crosshairs become hidden and hidden crosshairs become enabled. The resulting state is reflected by the -hide configuration option.

CROSSHAIRS toggle

Return value

Nothing.

ELEMENT

A command ensemble.

ELEMENT subcommand ...

Description

The ensemble supports the following subcommands:

activate

Queries or changes the active state of graph elements. With no arguments, returns the names of all active elements. With an element name and no indices, activates the complete element. With one or more indices, activates only those data points and replaces the element’s previous active-index selection.

bind

Queries or modifies event bindings for element binding tags. With no arguments, returns the currently known element binding tags. With a tag name, returns the event sequences bound to that tag. With a tag and sequence, returns the corresponding binding script. With a command, creates or replaces the binding.

cget

Queries the current value of an element configuration option. The available options depend on the concrete element type.

closest

Finds the visible element nearest to the specified window coordinate. On success, stores information in the Tcl array varName using the common keys name, index, x, y, and dist. A selected line or Polar element with a valid -param mapping additionally reports param. A selected bar element additionally reports its mapped rectangle geometry. A selected element in a polar widget additionally reports radius and angle; in Smith representation it also reports Gamma, normalized and physical impedance, normalized and physical admittance, and z0. See Polar elements for the complete Polar/Smith result set.

configure

Queries or modifies element configuration. When querying, one element name is supplied. When setting options, multiple element names may precede the option/value pairs and the same configuration is applied to each named element.

create

Creates a new graph element. GRAPHINST element create uses the widget’s default element type:

deactivate

Clears the active state and any active-point selection for one or more elements.

delete

Deletes one or more elements and releases their associated resources, bindings, legend entries, vector references, and display-list entries.

exists

Tests whether an element with the specified name exists in the graph.

get

Gives back the element currently selected by the graph binding machinery. The only supported selector is current. If there is no current element, the result is empty.

names

Gives back the names of existing graph elements. With no patterns, all element names are returned. With one or more Tcl glob patterns, an element is returned if its name matches any pattern.

show

Queries or replaces the element display list. With no argument, returns the currently displayed elements in drawing order. With elemList, displays only the listed elements and hides all others. The list order determines drawing order; later elements are drawn above earlier elements. Unknown element names are ignored. An empty list hides all elements.

type

Gives back the concrete class of the named element. Current results are LineElement, BarElement, StripElement, and PolarElement.

Refer to the documentation of each subcommand for details.

ELEMENT activate

Queries or changes the active state of graph elements. With no arguments, returns the names of all active elements. With an element name and no indices, activates the complete element. With one or more indices, activates only those data points and replaces the element’s previous active-index selection.

ELEMENT activate elemName ?index ...?

Parameters

elemName:

Name of the element to activate.

index:

Data index to activate; may be end or a Tcl integer expression.

Return value

List of active element names when querying; nothing when changing activation.

ELEMENT bind

Queries or modifies event bindings for element binding tags. With no arguments, returns the currently known element binding tags. With a tag name, returns the event sequences bound to that tag. With a tag and sequence, returns the corresponding binding script. With a command, creates or replaces the binding.

ELEMENT bind tagName
ELEMENT bind tagName sequence
ELEMENT bind tagName sequence command

Parameters

command:

Tcl script to execute for the binding.

sequence:

Tk event sequence.

tagName:

Element name, element class, or user-defined binding tag.

Return value

Binding tags, event sequences, or a binding script when querying; nothing when setting a binding.

ELEMENT cget

Queries the current value of an element configuration option. The available options depend on the concrete element type.

ELEMENT cget elemName option

Parameters

elemName:

Name of the element.

option:

Element configuration option.

Description

See LINEELEMENT for line-element options, STRIPELEMENT for strip-element options, and BARELEMENT for bar-element options.

Return value

Current value of option.

ELEMENT closest

Finds the visible element nearest to the specified window coordinate. On success, stores information in the Tcl array varName using the common keys name, index, x, y, and dist. A selected line or Polar element with a valid -param mapping additionally reports param. A selected bar element additionally reports its mapped rectangle geometry. A selected element in a polar widget additionally reports radius and angle; in Smith representation it also reports Gamma, normalized and physical impedance, normalized and physical admittance, and z0. See Polar elements for the complete Polar/Smith result set.

ELEMENT closest x y varName ?option value ...? ?--? ?elemName ...?

Parameters

x:

X coordinate in window coordinates.

y:

Y coordinate in window coordinates.

varName:

Name of the Tcl array in which result information is stored.

-along direction:

Measure distance along x, y, or both; the default is both.

-halo distance:

Maximum non-negative search distance in screen pixels; the graph -halo value is the default.

-interpolate boolean:

For line, strip, and polar elements, searches along the rendered trace when true instead of considering only data points.

elemName:

Optional element name restricting the search.

Return value

1 if an element is found within the halo, otherwise 0.

ELEMENT configure

Queries or modifies element configuration. When querying, one element name is supplied. When setting options, multiple element names may precede the option/value pairs and the same configuration is applied to each named element.

ELEMENT configure elemName
ELEMENT configure elemName option
ELEMENT configure elemName ?elemName ...? ?option value ...?

Parameters

elemName:

Name of an element to query or configure.

option:

Element configuration option.

value:

New value for the option.

Description

Available options depend on the concrete element type. See LINEELEMENT for line-element options, STRIPELEMENT for strip-element options, and BARELEMENT for bar-element options.

Return value

Configuration information when querying; nothing when setting options.

ELEMENT create

Creates a new graph element. GRAPHINST element create uses the widget’s default element type:

ELEMENT create elemName ?option value ...?

Parameters

elemName:

Not documented.

Description

  • graph creates a line element;

  • barchart creates a bar element;

  • stripchart creates a strip element;

  • polar creates a polar element. GRAPHINST line create always creates a line element and GRAPHINST bar create always creates a bar element, regardless of the widget’s default element type.

elemName:

Name of the new element.

option:

Element configuration option.

value:

Initial value for the option.

See LINEELEMENT for line-element options, STRIPELEMENT for strip-element options, BARELEMENT for bar-element options and POLARELEMENT for polar-element options

Return value

Name of the newly created element.

ELEMENT deactivate

Clears the active state and any active-point selection for one or more elements.

ELEMENT deactivate ?elemName ...?

Parameters

elemName:

Name of an element to deactivate.

Return value

Nothing.

ELEMENT delete

Deletes one or more elements and releases their associated resources, bindings, legend entries, vector references, and display-list entries.

ELEMENT delete ?elemName ...?

Parameters

elemName:

Name of an element to delete.

Return value

Nothing.

ELEMENT exists

Tests whether an element with the specified name exists in the graph.

ELEMENT exists elemName

Parameters

elemName:

Element name to test.

Return value

Boolean value.

ELEMENT get

Gives back the element currently selected by the graph binding machinery. The only supported selector is current. If there is no current element, the result is empty.

ELEMENT get name

Parameters

name:

Information to retrieve; must currently be current.

Return value

Current element name or an empty result.

ELEMENT names

Gives back the names of existing graph elements. With no patterns, all element names are returned. With one or more Tcl glob patterns, an element is returned if its name matches any pattern.

ELEMENT names ?pattern ...?

Parameters

pattern:

Optional Tcl glob pattern used to select element names.

Return value

List of matching element names.

ELEMENT show

Queries or replaces the element display list. With no argument, returns the currently displayed elements in drawing order. With elemList, displays only the listed elements and hides all others. The list order determines drawing order; later elements are drawn above earlier elements. Unknown element names are ignored. An empty list hides all elements.

ELEMENT show elemList

Parameters

elemList:

Optional Tcl list of element names to display.

Return value

Current element display list.

ELEMENT type

Gives back the concrete class of the named element. Current results are LineElement, BarElement, StripElement, and PolarElement.

ELEMENT type elemName

Parameters

elemName:

Name of the element.

Return value

Element class name.

graph

Creates a graph widget. A graph uses line elements as its default element type. The widget supports the common graph components such as axes, elements, markers, pens, legends, grids, crosshairs, and PostScript output. Configuration options supplied when the widget is created are the same options accepted later by GRAPHINST configure.

graph pathName ?option value ...?

Parameters

pathName:

Tk pathname of the graph widget to create.

option:

Graph widget configuration option.

value:

Value for the configuration option.

Description

Example:

graph .g -title "Example graph" -width 800 -height 500
pack .g -fill both -expand yes

Return value

The pathname of the newly created graph widget.

GRAPHINST

A command ensemble.

GRAPHINST subcommand ...

Description

The ensemble supports the following subcommands:

axis

Performs an operation on the graph’s virtual axes. Virtual axes can be created, deleted, configured, transformed, bound to events, and mapped to graph margins.

bar

Performs an element operation using bar elements explicitly, regardless of the default element type of the graph widget.

cget

Queries the current value of a graph widget configuration option.

configure

Queries or modifies graph widget configuration options. With no arguments, returns configuration information for all widget options. With one option, returns configuration information for that option. With one or more option/value pairs, changes the specified options.

crosshairs

Performs an operation on the graph crosshairs.

element

Performs an operation on graph elements using the widget’s default element type. The default is a line element for graph, a bar element for barchart, and a strip element for stripchart.

extents

Gives back the size or geometry of a graph component.

grid

Performs an operation on the graph grid.

inside

Tests whether a window coordinate lies inside the graph plotting area.

invtransform

Converts a point from window coordinates to graph coordinates using the graph’s primary X and Y axes. winX and winY may be Tcl expressions that evaluate to numeric values.

legend

Performs an operation on the graph legend.

line

Performs an element operation using line elements explicitly, regardless of the default element type of the graph widget.

marker

Performs an operation on graph markers.

pen

Performs an operation on graph pens. Pens define reusable drawing attributes for line and bar elements.

postscript

Performs a PostScript output operation for the graph.

snap

Renders a snapshot of the graph. By default the snapshot is written to an existing Tk photo image. On Windows, snapshots can also be written as Windows Metafile (wmf) or Enhanced Metafile (emf) output.

svg

Performs an SVG output operation. See SVG for options and export limitations.

transform

Converts a point from graph coordinates to window coordinates using the graph’s primary X and Y axes. x and y may be Tcl expressions that evaluate to numeric values.

x2axis

Performs an operation on the axis mapped to the secondary X-axis margin. With a normal graph orientation this is the top margin.

xaxis

Performs an operation on the axis mapped to the primary X-axis margin. With a normal graph orientation this is the bottom margin.

y2axis

Performs an operation on the axis mapped to the secondary Y-axis margin. With a normal graph orientation this is the right margin.

yaxis

Performs an operation on the axis mapped to the primary Y-axis margin. With a normal graph orientation this is the left margin.

Refer to the documentation of each subcommand for details.

GRAPHINST axis

Performs an operation on the graph’s virtual axes. Virtual axes can be created, deleted, configured, transformed, bound to events, and mapped to graph margins.

GRAPHINST axis operation ?args ...?

Parameters

Description

See AXIS for the complete virtual-axis command and option reference.

Return value

Result of the selected axis operation.

GRAPHINST bar

Performs an element operation using bar elements explicitly, regardless of the default element type of the graph widget.

GRAPHINST bar operation ?args ...?

Parameters

Return value

Result of the selected element operation.

GRAPHINST cget

Queries the current value of a graph widget configuration option.

GRAPHINST cget option

Parameters

option:

Graph widget configuration option.

Description

See Widget options for the complete list of supported options and their descriptions.

Return value

Current value of option.

GRAPHINST configure

Queries or modifies graph widget configuration options. With no arguments, returns configuration information for all widget options. With one option, returns configuration information for that option. With one or more option/value pairs, changes the specified options.

GRAPHINST configure option
GRAPHINST configure ?option value ...?

Parameters

option:

Graph widget configuration option.

value:

New value for the option.

Description

See Widget options for the complete list of supported options and their descriptions.

Return value

Configuration information when querying; nothing when setting options.

GRAPHINST crosshairs

Performs an operation on the graph crosshairs.

GRAPHINST crosshairs operation ?args ...?

Parameters

Return value

Result of the selected crosshairs operation.

GRAPHINST element

Performs an operation on graph elements using the widget’s default element type. The default is a line element for graph, a bar element for barchart, and a strip element for stripchart.

GRAPHINST element operation ?args ...?

Parameters

Return value

Result of the selected element operation.

GRAPHINST extents

Gives back the size or geometry of a graph component.

GRAPHINST extents item

Parameters

item:

Component whose extents are requested. Must be plotheight, plotwidth, plotarea, legend, leftmargin, rightmargin, topmargin, or bottommargin.

Return value

For plotheight, plotwidth, and the margin items, returns one size in pixels. For plotarea and legend, returns a list of four values in the form x y width height.

GRAPHINST grid

Performs an operation on the graph grid.

GRAPHINST grid operation ?args ...?

Parameters

Return value

Result of the selected grid operation.

GRAPHINST inside

Tests whether a window coordinate lies inside the graph plotting area.

GRAPHINST inside winX winY

Parameters

winX:

X coordinate in window coordinates.

winY:

Y coordinate in window coordinates.

Return value

Boolean value indicating whether the point is inside the plotting area.

GRAPHINST invtransform

Converts a point from window coordinates to graph coordinates using the graph’s primary X and Y axes. winX and winY may be Tcl expressions that evaluate to numeric values.

GRAPHINST invtransform winX winY

Parameters

winX:

X coordinate in window coordinates.

winY:

Y coordinate in window coordinates.

Return value

A two-element list containing the corresponding graph coordinates x y.

GRAPHINST legend

Performs an operation on the graph legend.

GRAPHINST legend operation ?args ...?

Parameters

Return value

Result of the selected legend operation.

GRAPHINST line

Performs an element operation using line elements explicitly, regardless of the default element type of the graph widget.

GRAPHINST line operation ?args ...?

Parameters

Return value

Result of the selected element operation.

GRAPHINST marker

Performs an operation on graph markers.

GRAPHINST marker operation ?args ...?

Parameters

Return value

Result of the selected marker operation.

GRAPHINST pen

Performs an operation on graph pens. Pens define reusable drawing attributes for line and bar elements.

GRAPHINST pen operation ?args ...?

Parameters

Return value

Result of the selected pen operation.

GRAPHINST postscript

Performs a PostScript output operation for the graph.

GRAPHINST postscript operation ?args ...?

Parameters

Return value

Result of the selected PostScript operation.

GRAPHINST snap

Renders a snapshot of the graph. By default the snapshot is written to an existing Tk photo image. On Windows, snapshots can also be written as Windows Metafile (wmf) or Enhanced Metafile (emf) output.

GRAPHINST snap name ?-format format? ?-height height? ?-width width?

Parameters

-format format:

Output format. photo is available on all platforms. wmf and emf are available on Windows. The default is photo.

-height height:

Height of the rendered snapshot. If omitted, the current widget height is used.

-width width:

Width of the rendered snapshot. If omitted, the current widget width is used.

name:

For photo format, name of an existing Tk photo image; for wmf or emf, output filename. On Windows, CLIPBOARD writes metafile output to the clipboard instead of a file.

Description

Example:

image create photo graphImage
.g snap graphImage

.g snap graphImage -width 1200 -height 800

Return value

Nothing.

GRAPHINST svg

Performs an SVG output operation. See SVG for options and export limitations.

GRAPHINST svg cget option
GRAPHINST svg configure ?option? ?value ...?
GRAPHINST svg output ?file? ?option value ...?

Parameters

Return value

Option information, an SVG XML string, or nothing when writing a file.

GRAPHINST transform

Converts a point from graph coordinates to window coordinates using the graph’s primary X and Y axes. x and y may be Tcl expressions that evaluate to numeric values.

GRAPHINST transform x y

Parameters

x:

X coordinate in graph coordinates.

y:

Y coordinate in graph coordinates.

Return value

A two-element list containing the corresponding integer window coordinates x y.

GRAPHINST x2axis

Performs an operation on the axis mapped to the secondary X-axis margin. With a normal graph orientation this is the top margin.

GRAPHINST x2axis operation ?args ...?

Parameters

Return value

Result of the selected margin-axis operation.

GRAPHINST xaxis

Performs an operation on the axis mapped to the primary X-axis margin. With a normal graph orientation this is the bottom margin.

GRAPHINST xaxis operation ?args ...?

Parameters

Return value

Result of the selected margin-axis operation.

GRAPHINST y2axis

Performs an operation on the axis mapped to the secondary Y-axis margin. With a normal graph orientation this is the right margin.

GRAPHINST y2axis operation ?args ...?

Parameters

Return value

Result of the selected margin-axis operation.

GRAPHINST yaxis

Performs an operation on the axis mapped to the primary Y-axis margin. With a normal graph orientation this is the left margin.

GRAPHINST yaxis operation ?args ...?

Parameters

Return value

Result of the selected margin-axis operation.

GRID

A command ensemble.

GRID subcommand ...

Description

The ensemble supports the following subcommands:

cget

Queries the current value of one grid configuration option. See Grid options.

configure

Queries or modifies grid configuration options. With no arguments, returns all configuration information. With one option, returns information for that option. Otherwise args contains option/value pairs to change. See Grid options.

off

Hides the grid. This is equivalent to setting -hide yes. If the grid is already hidden, the operation has no effect.

on

Displays the grid. This is equivalent to setting -hide no. If the grid is already displayed, the operation has no effect.

toggle

Toggles grid visibility. A visible grid becomes hidden and a hidden grid becomes visible. The resulting state is reflected by the -hide configuration option.

Refer to the documentation of each subcommand for details.

GRID cget

Queries the current value of one grid configuration option. See Grid options.

GRID cget option

Parameters

option:

Grid configuration option.

Return value

Current value of the requested option.

GRID configure

Queries or modifies grid configuration options. With no arguments, returns all configuration information. With one option, returns information for that option. Otherwise args contains option/value pairs to change. See Grid options.

GRID configure ?option? ?value ...?

Parameters

option:

Grid configuration option.

value:

New value for the option.

Return value

Configuration information when querying, otherwise nothing.

GRID off

Hides the grid. This is equivalent to setting -hide yes. If the grid is already hidden, the operation has no effect.

GRID off

Return value

Nothing.

GRID on

Displays the grid. This is equivalent to setting -hide no. If the grid is already displayed, the operation has no effect.

GRID on

Return value

Nothing.

GRID toggle

Toggles grid visibility. A visible grid becomes hidden and a hidden grid becomes visible. The resulting state is reflected by the -hide configuration option.

GRID toggle

Return value

Nothing.

LEGEND

A command ensemble.

LEGEND subcommand ...

Description

The ensemble supports the following subcommands:

activate

Marks matching legend entries active. Each pattern is matched against element names. After applying all patterns, the command returns the names of all legend entries that are currently active. A pattern that matches no element has no effect.

bind

Queries or changes event bindings for legend entries associated with tagName. Element names are implicit binding tags. With no sequence, returns the bound event sequences. With a sequence but no command, returns the current binding. With a sequence and command, creates or replaces the binding; a command beginning with + appends to an existing binding.

cget

Queries the current value of one legend configuration option. See Legend options.

configure

Queries or modifies legend configuration options. With no arguments, returns all configuration information. With one option, returns information for that option. Otherwise args contains option/value pairs to change. See Legend options.

deactivate

Marks matching legend entries inactive. Each pattern is matched against element names. Inactive entries are drawn using the normal legend appearance. A pattern that matches no element has no effect.

get

Gives back the element name represented by the legend entry at position. position may be current, meaning the legend entry currently under the pointer, or an explicit screen coordinate of the form @x,y. If no legend entry is present at the requested position, an empty string is returned.

Refer to the documentation of each subcommand for details.

LEGEND activate

Marks matching legend entries active. Each pattern is matched against element names. After applying all patterns, the command returns the names of all legend entries that are currently active. A pattern that matches no element has no effect.

LEGEND activate pattern ?pattern ...?

Parameters

pattern:

Glob pattern selecting element names whose legend entries are activated.

Return value

List of all currently active legend entries.

LEGEND bind

Queries or changes event bindings for legend entries associated with tagName. Element names are implicit binding tags. With no sequence, returns the bound event sequences. With a sequence but no command, returns the current binding. With a sequence and command, creates or replaces the binding; a command beginning with + appends to an existing binding.

LEGEND bind tagName ?sequence? ?command?

Parameters

tagName:

Legend entry binding tag.

command:

Optional Tcl command associated with the event sequence.

sequence:

Optional event sequence.

Return value

Binding information when querying, otherwise nothing.

LEGEND cget

Queries the current value of one legend configuration option. See Legend options.

LEGEND cget option

Parameters

option:

Legend configuration option.

Return value

Current value of the requested option.

LEGEND configure

Queries or modifies legend configuration options. With no arguments, returns all configuration information. With one option, returns information for that option. Otherwise args contains option/value pairs to change. See Legend options.

LEGEND configure ?option? ?value ...?

Parameters

option:

Legend configuration option.

value:

New value for the option.

Return value

Configuration information when querying, otherwise nothing.

LEGEND deactivate

Marks matching legend entries inactive. Each pattern is matched against element names. Inactive entries are drawn using the normal legend appearance. A pattern that matches no element has no effect.

LEGEND deactivate pattern ?pattern ...?

Parameters

pattern:

Glob pattern selecting element names whose legend entries are deactivated.

Return value

Nothing.

LEGEND get

Gives back the element name represented by the legend entry at position. position may be current, meaning the legend entry currently under the pointer, or an explicit screen coordinate of the form @x,y. If no legend entry is present at the requested position, an empty string is returned.

LEGEND get current|@x,y

Parameters

position:

current or a screen position of the form @x,y.

Return value

Name of the corresponding graph element, or an empty string if no entry is found.

MARGINAXIS

A command ensemble.

MARGINAXIS subcommand ...

Description

The ensemble supports the following subcommands:

bind

Queries or modifies event bindings for the first axis assigned to this margin. With no arguments, returns the event sequences currently bound to the axis. With a sequence, returns the corresponding binding script. With both a sequence and command, creates or replaces the binding.

cget

Queries the current value of a configuration option for the first axis assigned to this margin. See AXIS for the complete axis option reference.

configure

Queries or modifies configuration options of the first axis assigned to this margin. With no arguments, returns configuration information for all axis options. With one option, returns configuration information for that option. With option/value pairs, changes the specified options. See AXIS for the complete axis option reference.

invtransform

Converts an integer window coordinate to the corresponding graph-coordinate value using the first axis assigned to this margin. Axis orientation, descending direction, and logarithmic mapping are taken into account.

limits

Gives back the effective displayed limits of the first axis assigned to this margin. Automatic scaling, explicit limits, loose-range processing, and logarithmic mapping are reflected in the result. Logarithmic limits are returned as ordinary positive data values rather than base-10 exponents.

transform

Converts a graph-coordinate value to an integer window coordinate using the first axis assigned to this margin. value may be a Tcl numeric expression and must evaluate to a finite value. Values transformed through a logarithmic axis must be positive.

use

Queries or changes the ordered list of virtual axes assigned to this margin. With no argument, returns all currently assigned axis names. With axisList, replaces the current assignment with the supplied list. The first axis becomes the primary axis addressed by the other MARGINAXIS operations. Assigning an axis that is already displayed in another margin moves it to this margin. An empty list removes all axes.

Refer to the documentation of each subcommand for details.

MARGINAXIS bind

Queries or modifies event bindings for the first axis assigned to this margin. With no arguments, returns the event sequences currently bound to the axis. With a sequence, returns the corresponding binding script. With both a sequence and command, creates or replaces the binding.

MARGINAXIS bind sequence
MARGINAXIS bind sequence command

Parameters

command:

Tcl script to execute for the binding.

sequence:

Tk event sequence.

Return value

Event sequences or a binding script when querying; nothing when setting a binding.

MARGINAXIS cget

Queries the current value of a configuration option for the first axis assigned to this margin. See AXIS for the complete axis option reference.

MARGINAXIS cget option

Parameters

option:

Axis configuration option.

Return value

Current value of option.

MARGINAXIS configure

Queries or modifies configuration options of the first axis assigned to this margin. With no arguments, returns configuration information for all axis options. With one option, returns configuration information for that option. With option/value pairs, changes the specified options. See AXIS for the complete axis option reference.

MARGINAXIS configure option
MARGINAXIS configure ?option value ...?

Parameters

option:

Axis configuration option.

value:

New value for the option.

Return value

Configuration information when querying; nothing when setting options.

MARGINAXIS invtransform

Converts an integer window coordinate to the corresponding graph-coordinate value using the first axis assigned to this margin. Axis orientation, descending direction, and logarithmic mapping are taken into account.

MARGINAXIS invtransform value

Parameters

value:

Integer window coordinate.

Return value

Corresponding graph-coordinate value.

MARGINAXIS limits

Gives back the effective displayed limits of the first axis assigned to this margin. Automatic scaling, explicit limits, loose-range processing, and logarithmic mapping are reflected in the result. Logarithmic limits are returned as ordinary positive data values rather than base-10 exponents.

MARGINAXIS limits

Return value

Two-element list min max.

MARGINAXIS transform

Converts a graph-coordinate value to an integer window coordinate using the first axis assigned to this margin. value may be a Tcl numeric expression and must evaluate to a finite value. Values transformed through a logarithmic axis must be positive.

MARGINAXIS transform value

Parameters

value:

Graph-coordinate value or Tcl numeric expression.

Return value

Corresponding integer window coordinate.

MARGINAXIS use

Queries or changes the ordered list of virtual axes assigned to this margin. With no argument, returns all currently assigned axis names. With axisList, replaces the current assignment with the supplied list. The first axis becomes the primary axis addressed by the other MARGINAXIS operations. Assigning an axis that is already displayed in another margin moves it to this margin. An empty list removes all axes.

MARGINAXIS use axisList

Parameters

axisList:

Tcl list containing zero or more virtual axis names.

Return value

Ordered list of assigned axis names when querying; nothing when changing the assignment.

MARKER

A command ensemble.

MARKER subcommand ...

Description

The ensemble supports the following subcommands:

after

Changes the position of a marker in the marker display list. If afterMarker is specified, markerName is moved immediately after it. If it is omitted, markerName is moved to the end of the marker display list.

before

Changes the position of a marker in the marker display list. If beforeMarker is specified, markerName is moved immediately before it. If it is omitted, markerName is moved to the beginning of the marker display list.

bind

Queries or changes marker bindings. With no arguments, returns the known marker binding tags. With only a tag name, returns the event sequences bound to that tag. With a tag and sequence, returns the binding for that sequence. With a command as well, creates or replaces the binding; a command beginning with + appends to the existing binding.

cget

Queries the current value of one configuration option of a marker. The available options depend on the concrete marker type. See Marker types and options.

configure

Queries or modifies marker configuration options. One or more marker names may be supplied before the first option. With no option, returns all configuration information for the first marker. With one option, returns information for that option for the first marker. With option/value pairs, applies the same changes to every listed marker. See Marker types and options.

create

Creates a new marker of the specified type. type may be bitmap, image, line, polygon, text, or window. Use -name to specify an explicit marker name; otherwise Rbc generates one automatically. Creating a marker with the same name as an existing marker replaces the existing marker. See Marker types and options.

delete

Deletes one or more markers. Supplying no marker names has no effect.

exists

Reports whether a marker with the specified name exists.

find

Finds the first displayed marker relative to a rectangular screen region. mode may be enclosed, which requires the marker to be contained by the region, or overlapping, which requires it to intersect the region. Hidden markers and markers associated with hidden elements are ignored.

get

Gives back the marker currently selected by the graph’s binding machinery. The supported selector is current. If there is no current marker, an empty string is returned.

names

Gives back marker names. If patterns are supplied, only marker names matching at least one glob pattern are returned.

type

Gives back the concrete type of an existing marker.

Refer to the documentation of each subcommand for details.

MARKER after

Changes the position of a marker in the marker display list. If afterMarker is specified, markerName is moved immediately after it. If it is omitted, markerName is moved to the end of the marker display list.

MARKER after markerName ?afterMarker?

Parameters

markerName:

Name of the marker to move.

afterMarker:

Optional marker after which markerName is placed.

Return value

Nothing.

MARKER before

Changes the position of a marker in the marker display list. If beforeMarker is specified, markerName is moved immediately before it. If it is omitted, markerName is moved to the beginning of the marker display list.

MARKER before markerName ?beforeMarker?

Parameters

markerName:

Name of the marker to move.

beforeMarker:

Optional marker before which markerName is placed.

Return value

Nothing.

MARKER bind

Queries or changes marker bindings. With no arguments, returns the known marker binding tags. With only a tag name, returns the event sequences bound to that tag. With a tag and sequence, returns the binding for that sequence. With a command as well, creates or replaces the binding; a command beginning with + appends to the existing binding.

MARKER bind ?tagName? ?sequence? ?command?

Parameters

command:

Optional Tcl command to invoke for the binding.

sequence:

Optional event sequence.

tagName:

Optional marker binding tag.

Return value

Binding tags or binding information when querying, otherwise nothing.

MARKER cget

Queries the current value of one configuration option of a marker. The available options depend on the concrete marker type. See Marker types and options.

MARKER cget markerName option

Parameters

markerName:

Name of the marker.

option:

Marker configuration option.

Return value

Current value of the requested option.

MARKER configure

Queries or modifies marker configuration options. One or more marker names may be supplied before the first option. With no option, returns all configuration information for the first marker. With one option, returns information for that option for the first marker. With option/value pairs, applies the same changes to every listed marker. See Marker types and options.

MARKER configure markerName ?markerName ...? ?option value ...?

Parameters

markerName:

Name of a marker to query or configure.

option:

Marker configuration option.

value:

New value for the option.

Return value

Configuration information when querying, otherwise nothing.

MARKER create

Creates a new marker of the specified type. type may be bitmap, image, line, polygon, text, or window. Use -name to specify an explicit marker name; otherwise Rbc generates one automatically. Creating a marker with the same name as an existing marker replaces the existing marker. See Marker types and options.

MARKER create type ?option value ...?

Parameters

type:

Type of marker to create.

option:

Initial marker configuration option.

value:

Initial value for the option.

Return value

Name of the newly created marker.

MARKER delete

Deletes one or more markers. Supplying no marker names has no effect.

MARKER delete ?markerName ...?

Parameters

markerName:

Name of a marker to delete.

Return value

Nothing.

MARKER exists

Reports whether a marker with the specified name exists.

MARKER exists markerName

Parameters

markerName:

Marker name to test.

Return value

1 if the marker exists and 0 otherwise.

MARKER find

Finds the first displayed marker relative to a rectangular screen region. mode may be enclosed, which requires the marker to be contained by the region, or overlapping, which requires it to intersect the region. Hidden markers and markers associated with hidden elements are ignored.

MARKER find enclosed|overlapping x1 y1 x2 y2

Parameters

mode:

Search mode, enclosed or overlapping.

x1:

First X coordinate of the search rectangle.

y1:

First Y coordinate of the search rectangle.

x2:

Second X coordinate of the search rectangle.

y2:

Second Y coordinate of the search rectangle.

Return value

Name of the first matching marker, or an empty string if none matches.

MARKER get

Gives back the marker currently selected by the graph’s binding machinery. The supported selector is current. If there is no current marker, an empty string is returned.

MARKER get current

Parameters

name:

Marker selector; currently current.

Return value

Name of the current marker, or an empty string.

MARKER names

Gives back marker names. If patterns are supplied, only marker names matching at least one glob pattern are returned.

MARKER names ?pattern ...?

Parameters

pattern:

Optional glob pattern used to select marker names.

Return value

List of marker names.

MARKER type

Gives back the concrete type of an existing marker.

MARKER type markerName

Parameters

markerName:

Name of the marker.

Return value

Marker type: bitmap, image, line, polygon, text, or window.

PEN

A command ensemble.

PEN subcommand ...

Description

The ensemble supports the following subcommands:

cget

Queries the current value of a pen configuration option. Available options depend on whether the named pen is a line or bar pen. See line pen options and bar pen options.

configure

Queries or modifies pen configuration options. One or more pen names may be supplied before the first option. With no option, returns all configuration information for the first pen. With one option, returns information for that option for the first pen. With option/value pairs, applies the same changes to every listed pen. See line pen options and bar pen options.

create

Creates a new named pen. -type line creates a line pen, -type bar creates a bar pen, and -type strip creates a line pen suitable for strip elements. If -type is omitted, the graph widget’s default element type determines the pen type. See line pen options and bar pen options.

delete

Deletes one or more named pens. If a pen is still referenced by an element, destruction is deferred until its final reference is released. The deleted pen name immediately stops being available for new references.

names

Gives back names of existing pens. With one or more Tcl glob patterns, a pen is returned when its name matches any pattern. Pens pending deletion are not returned.

type

Gives back the concrete class of the named pen. Line and strip pens return LineElement; bar pens return BarElement. This reports the actual pen implementation and is independent of the textual creation-time -type representation.

Refer to the documentation of each subcommand for details.

PEN cget

Queries the current value of a pen configuration option. Available options depend on whether the named pen is a line or bar pen. See line pen options and bar pen options.

PEN cget penName option

Parameters

penName:

Name of the pen.

option:

Pen configuration option.

Return value

Current value of option.

PEN configure

Queries or modifies pen configuration options. One or more pen names may be supplied before the first option. With no option, returns all configuration information for the first pen. With one option, returns information for that option for the first pen. With option/value pairs, applies the same changes to every listed pen. See line pen options and bar pen options.

PEN configure penName ?penName ...? ?option value ...?

Parameters

penName:

Name of a pen to query or configure.

option:

Pen configuration option.

value:

New value for the option.

Return value

Configuration information when querying, otherwise nothing.

PEN create

Creates a new named pen. -type line creates a line pen, -type bar creates a bar pen, and -type strip creates a line pen suitable for strip elements. If -type is omitted, the graph widget’s default element type determines the pen type. See line pen options and bar pen options.

PEN create penName ?option value ...?

Parameters

penName:

Unique name of the new pen.

option:

Initial pen configuration option.

value:

Initial value for the option.

Return value

Name of the newly created pen.

PEN delete

Deletes one or more named pens. If a pen is still referenced by an element, destruction is deferred until its final reference is released. The deleted pen name immediately stops being available for new references.

PEN delete ?penName ...?

Parameters

penName:

Name of a pen to delete.

Return value

Nothing.

PEN names

Gives back names of existing pens. With one or more Tcl glob patterns, a pen is returned when its name matches any pattern. Pens pending deletion are not returned.

PEN names ?pattern ...?

Parameters

pattern:

Optional Tcl glob pattern used to select pen names.

Return value

List of matching pen names.

PEN type

Gives back the concrete class of the named pen. Line and strip pens return LineElement; bar pens return BarElement. This reports the actual pen implementation and is independent of the textual creation-time -type representation.

PEN type penName

Parameters

penName:

Name of the pen.

Return value

LineElement or BarElement.

polar

Creates a polar graph widget. A polar widget uses polar elements as its default element type and represents data in the Cartesian complex plane, where X is the real coordinate and Y is the imaginary coordinate.

polar pathName ?option value ...?

Parameters

pathName:

Tk pathname of the polar widget to create.

option:

Graph widget configuration option.

value:

Value for the configuration option.

Description

The -representation option selects either a conventional polar grid or a Smith-chart grid. The underlying element coordinates remain Cartesian in both representations.

Polar elements may use ordinary X/Y data or may obtain their data directly from a complex Rbc vector with the element -cdata option. Complex data may represent reflection coefficient, impedance, or admittance.

Unless -aspect is explicitly configured, a polar widget automatically adjusts the physical plotting-area aspect ratio so that one X data unit and one Y data unit have the same screen scale. This keeps polar circles and Smith-chart circles circular even when the mapped X and Y numerical ranges have different spans.

Example:

vector create gamma -type complex
gamma set {{0 0} {0.25 0.4} {-0.2 0.6}}

polar .p -representation smith -width 600 -height 500
.p element create trace -cdata gamma -smooth natural
pack .p -fill both -expand yes

Return value

The pathname of the newly created polar widget.

POSTSCRIPT

A command ensemble.

POSTSCRIPT subcommand ...

Description

The ensemble supports the following subcommands:

cget

Queries the current value of one PostScript configuration option. See PostScript options.

configure

Queries or modifies PostScript configuration options. With no arguments, returns all configuration information. With one option, returns information for that option. Otherwise args contains option/value pairs to change. See PostScript options.

output

Generates an Encapsulated PostScript representation of the graph. If fileName is supplied, the output is written to that file; otherwise the generated PostScript is returned as the command result. Configuration options may be supplied after the optional filename and remain installed after successful output.

Refer to the documentation of each subcommand for details.

POSTSCRIPT cget

Queries the current value of one PostScript configuration option. See PostScript options.

POSTSCRIPT cget option

Parameters

option:

PostScript configuration option.

Return value

Current value of the requested option.

POSTSCRIPT configure

Queries or modifies PostScript configuration options. With no arguments, returns all configuration information. With one option, returns information for that option. Otherwise args contains option/value pairs to change. See PostScript options.

POSTSCRIPT configure ?option? ?value ...?

Parameters

option:

PostScript configuration option.

value:

New value for the option.

Return value

Configuration information when querying, otherwise nothing.

POSTSCRIPT output

Generates an Encapsulated PostScript representation of the graph. If fileName is supplied, the output is written to that file; otherwise the generated PostScript is returned as the command result. Configuration options may be supplied after the optional filename and remain installed after successful output.

POSTSCRIPT output ?fileName? ?option value ...?

Parameters

fileName:

Optional name of the file to create.

option:

Optional PostScript configuration option.

value:

Value for the configuration option.

Return value

Generated PostScript when no filename is supplied, otherwise nothing.

spline

A command ensemble.

spline subcommand ...

Description

The ensemble supports the following subcommands:

natural

Computes a scalar natural cubic spline through real source vectors x and y and evaluates it at every X coordinate in splX. Evaluation coordinates may appear in any order and may lie outside the source X range.

parametric

Computes a two-dimensional parametric spline through a complex source vector.

quadratic

Computes a scalar shape-preserving quadratic spline through real source vectors x and y and evaluates it at every X coordinate in splX. Evaluation coordinates may appear in any order and may lie outside the source X range.

Refer to the documentation of each subcommand for details.

spline natural

Computes a scalar natural cubic spline through real source vectors x and y and evaluates it at every X coordinate in splX. Evaluation coordinates may appear in any order and may lie outside the source X range.

spline natural x y splX splY

Parameters

x:

Real vector containing finite, strictly increasing X coordinates of the source points.

y:

Real vector containing finite Y coordinates; it must have the same length as x.

splX:

Real vector containing finite X coordinates at which the spline is evaluated.

splY:

Real result vector; it is created or resized as necessary.

Return value

Nothing.

spline parametric

Computes a two-dimensional parametric spline through a complex source vector.

spline parametric operation source result samples

Parameters

operation:

Interpolation algorithm; must be natural or quadratic.

source:

Complex vector containing at least three finite two-dimensional source points. Consecutive points must be distinct.

result:

Complex vector receiving the generated path. It is created or resized as necessary and may be the same vector as source.

samples:

Number of generated points. Must be at least two.

Description

Example:

vector create z -type complex
z set {{0 0} {1 1} {0 2} {-1 1} {0 0}}

spline parametric natural z smoothZ 200

Return value

Nothing.

spline quadratic

Computes a scalar shape-preserving quadratic spline through real source vectors x and y and evaluates it at every X coordinate in splX. Evaluation coordinates may appear in any order and may lie outside the source X range.

spline quadratic x y splX splY

Parameters

x:

Real vector containing finite, strictly increasing X coordinates of the source points.

y:

Real vector containing finite Y coordinates; it must have the same length as x.

splX:

Real vector containing finite X coordinates at which the spline is evaluated.

splY:

Real result vector; it is created or resized as necessary.

Return value

Nothing.

stripchart

Creates a stripchart widget. A stripchart uses strip elements as its default element type. It uses the same graph widget infrastructure and common components as graph, but elements created through the generic GRAPHINST element interface are strip elements by default. Configuration options supplied when the widget is created are the same options accepted later by GRAPHINST configure.

stripchart pathName ?option value ...?

Parameters

pathName:

Tk pathname of the stripchart widget to create.

option:

Graph widget configuration option.

value:

Value for the configuration option.

Description

Example:

stripchart .s -title "Example stripchart" -width 800 -height 500
pack .s -fill both -expand yes

Return value

The pathname of the newly created stripchart widget.

SVG

A command ensemble.

SVG subcommand ...

Description

The ensemble supports the following subcommands:

cget

Queries the current value of one SVG configuration option. See SVG options.

configure

Queries or modifies SVG configuration options. With no arguments, returns a list of all option descriptions. With one option, returns its five-element description. Otherwise accepts option/value pairs and updates the settings after validating the entire list. See SVG options.

output

Generates the SVG document. Without a filename, returns its XML text. With a filename, writes the document to that file, replacing existing contents. Optional settings remain configured after their option/value list is validated, including when a later rendering or file operation fails. Rendering and XML validation complete before the file is opened; an I/O failure can still leave a partial file. See Supported content and limitations.

Refer to the documentation of each subcommand for details.

SVG cget

Queries the current value of one SVG configuration option. See SVG options.

SVG cget option

Parameters

option:

SVG configuration option.

Return value

Current option value, as integer pixels for dimensions or 0/1 for decorations.

SVG configure

Queries or modifies SVG configuration options. With no arguments, returns a list of all option descriptions. With one option, returns its five-element description. Otherwise accepts option/value pairs and updates the settings after validating the entire list. See SVG options.

SVG configure option
SVG configure option value ?option value ...?

Parameters

option:

SVG configuration option.

value:

New value for the option.

Return value

Configuration information when querying, otherwise nothing.

SVG output

Generates the SVG document. Without a filename, returns its XML text. With a filename, writes the document to that file, replacing existing contents. Optional settings remain configured after their option/value list is validated, including when a later rendering or file operation fails. Rendering and XML validation complete before the file is opened; an I/O failure can still leave a partial file. See Supported content and limitations.

SVG output ?fileName? ?option value ...?

Parameters

fileName:

Optional file to create or replace; prefix dash-leading names with ./.

option:

Optional SVG configuration option.

value:

Value for the configuration option.

Return value

SVG XML when no filename is supplied, otherwise nothing.

VECINST

A command ensemble.

VECINST subcommand ...

Description

The ensemble supports the following subcommands:

*

Multiplies every value of the vector by a scalar or by the corresponding value of another vector. list may name another vector or contain a real or complex scalar. A complex scalar is written as {real imag}. If another vector is used, it must have the same number of selected values. Real operands are promoted to complex values when either operand is complex.

+

Adds a scalar or another vector component-by-component.

-

Subtracts a scalar or another vector component-by-component.

/

Divides every vector value by a scalar or by the corresponding value of another vector.

append

Appends values to the vector. Each item may be another vector or a Tcl list of values. A vector argument must have the same numeric type as this vector. For a complex vector, list elements may be {real imag} pairs or real scalars; real scalars are promoted to complex values with zero imaginary component.

binread

Reads native binary numeric values from a Tcl channel into the vector.

clear

Clears cached elements of the Tcl array associated with the vector. This does not remove values from the vector. It can be used to release memory occupied by cached array-index entries.

delete

Deletes one or more indices or index ranges from the vector. Remaining values are compacted after the deleted values are removed.

dup

Copies this vector into another vector. A newly created destination inherits the source vector’s numeric type. If the destination already exists, it must have the same numeric type and its contents are replaced.

expr

Evaluates expression and stores the result in this vector.

index

Reads or writes a vector value or range. With no value argument, returns the value or values selected by index. With value, assigns that numeric value to every element selected by index. The special ++end index may be used when setting a value to append one new element.

length

Queries or changes the vector length. If newSize is supplied, the vector is resized. New elements created by enlarging the vector are initialized by the vector resizing machinery.

merge

Interleaves values from two or more vectors and stores the result in this vector. All input vectors must contain the same number of selected values. All input vectors must have the same numeric type as this vector.

normalize

Normalizes real vector values to the range 0.0 through 1.0 using:

offset

Queries or changes the external index offset of the vector. The offset changes the numeric indices through which the vector is addressed without moving the underlying data.

populate

Creates a more densely sampled vector using linear interpolation. density intermediate values are inserted between every adjacent pair of source values. density must be at least 1. The destination may be the same vector as the source and has the same numeric type as the source. For complex vectors, the real and imaginary components are linearly interpolated independently.

random

Fills the vector with pseudo-random data while preserving its current length. For real vectors, one random value in the range [0.0, 1.0) is generated for each vector value. For complex vectors, the real and imaginary components are generated independently in that range.

range

Gives back an inclusive range of vector values. If first is less than or equal to last, values are returned in ascending index order. If first is greater than last, values are returned in descending index order. first and last are normal vector indices and may use forms such as end. This operation does not modify the vector.

search

Searches the vector for matching values. For real vectors, one numeric argument performs an exact-value search and two numeric arguments search the inclusive range from min to max, using the implementation’s floating-point tolerance. For complex vectors, only the one-value exact search is supported. The search value may be {real imag} or a real scalar, which is promoted to {value 0}. A two-bound complex range search is not supported. By default matching vector indices are returned. With -value, matching vector values are returned. Complex values returned by -value use {real imag} representation.

seq

Generates an arithmetic sequence.

set

Replaces the contents of the vector. list may be a Tcl list of numeric values or the name of another vector. When the argument names another vector, the source and destination vector types must match. For a complex destination, list elements may be {real imag} values or real scalars.

sort

Sorts this real vector. Additional real vectors may be supplied as secondary sort keys. All vectors must have the same length.

split

Distributes values from this vector among destination vectors in round-robin order. The source vector length must be evenly divisible by the number of destination vectors. Existing destination contents are preserved and the split values are appended. Destination vectors have the same numeric type as the source vector.

type

Returns the immutable numeric type of the vector. real or complex.

variable

Queries or changes the Tcl array variable associated with the vector. Supplying an empty variable name removes the current mapping. Real vectors normally receive an automatic array mapping at creation. Complex vectors do not receive an automatic mapping, but an explicit mapping is supported. Ordinary complex array elements use {real imag} representation. The calculated array indices min, max, mean, sum, and prod are not supported for complex vectors.

Refer to the documentation of each subcommand for details.

VECINST *

Multiplies every value of the vector by a scalar or by the corresponding value of another vector. list may name another vector or contain a real or complex scalar. A complex scalar is written as {real imag}. If another vector is used, it must have the same number of selected values. Real operands are promoted to complex values when either operand is complex.

VECINST * list

Parameters

list:

Vector name or scalar value.

Return value

A list containing the resulting values. Complex results are returned as {real imag} pairs. The vector itself is not modified.

VECINST +

Adds a scalar or another vector component-by-component.

VECINST + list

Parameters

list:

Vector name or scalar value.

Return value

A list containing the resulting values. The vector itself is not modified.

VECINST -

Subtracts a scalar or another vector component-by-component.

VECINST - list

Parameters

list:

Vector name or scalar value.

Return value

A list containing the resulting values. The vector itself is not modified.

VECINST /

Divides every vector value by a scalar or by the corresponding value of another vector.

VECINST / list

Parameters

list:

Vector name or scalar value.

Return value

A list containing the resulting values. The vector itself is not modified.

VECINST append

Appends values to the vector. Each item may be another vector or a Tcl list of values. A vector argument must have the same numeric type as this vector. For a complex vector, list elements may be {real imag} pairs or real scalars; real scalars are promoted to complex values with zero imaginary component.

VECINST append item ?item ...?

Parameters

Description

Clients are notified with the exact inclusive source range occupied by the newly appended values. This lets clients that maintain ranged caches update only the new tail instead of treating the operation as an unknown/full-vector modification.

item:

Vector name or list of values.

Return value

Nothing.

VECINST binread

Reads native binary numeric values from a Tcl channel into the vector.

VECINST binread channel ?numValues? ?-at index? ?-format format? ?-swap?

Parameters

-at index:

Starts storing values at index. Existing values are overwritten from that position. Without -at, values are appended to the vector.

-format format:

Native numeric input representation. Formats have the form i#, u#, r#, or f#, where # is the native type size in bytes. The default is the native C double representation.

-swap:

Reverses the byte order of each native scalar component.

channel:

Name of a readable Tcl channel.

numValues:

Optional maximum number of vector values to read. A value of zero, or omission of the argument, reads until EOF.

Description

For a real vector, each formatted scalar becomes one vector value.

For a complex vector, consecutive formatted scalars are interpreted as interleaved real and imaginary components:

real0 imag0 real1 imag1 ...

-format describes each scalar component. numValues, -at, and the return value count complex vector values rather than individual scalar components. -swap swaps the bytes inside each real and imaginary component independently and does not exchange the real and imaginary components.

The channel is temporarily placed in binary translation mode and its previous translation setting is restored before the command returns. Input must end on a complete vector-value boundary. In particular, complex input must contain complete real/imaginary pairs.

Return value

Number of complete vector values read.

VECINST clear

Clears cached elements of the Tcl array associated with the vector. This does not remove values from the vector. It can be used to release memory occupied by cached array-index entries.

VECINST clear

Return value

Nothing.

VECINST delete

Deletes one or more indices or index ranges from the vector. Remaining values are compacted after the deleted values are removed.

VECINST delete index ?index ...?

Parameters

index:

Vector index or colon-separated index range.

Return value

Nothing.

VECINST dup

Copies this vector into another vector. A newly created destination inherits the source vector’s numeric type. If the destination already exists, it must have the same numeric type and its contents are replaced.

VECINST dup vecName

Parameters

vecName:

Destination vector.

Return value

Nothing.

VECINST expr

Evaluates expression and stores the result in this vector.

VECINST expr expression

Parameters

expression:

Vector expression.

Return value

Nothing.

VECINST index

Reads or writes a vector value or range. With no value argument, returns the value or values selected by index. With value, assigns that numeric value to every element selected by index. The special ++end index may be used when setting a value to append one new element.

VECINST index index
VECINST index index value

Parameters

Description

A write through ++end is reported to vector clients as an exact ranged tail update, just like append. For complex vectors, values are returned as {real imag} pairs. A real assigned value is promoted to {value 0}.

index:

Vector index or range.

value:

Optional numeric value.

Return value

Selected value(s) when querying, or the assigned value when setting.

VECINST length

Queries or changes the vector length. If newSize is supplied, the vector is resized. New elements created by enlarging the vector are initialized by the vector resizing machinery.

VECINST length newSize

Parameters

newSize:

New non-negative vector length.

Return value

Current vector length.

VECINST merge

Interleaves values from two or more vectors and stores the result in this vector. All input vectors must contain the same number of selected values. All input vectors must have the same numeric type as this vector.

VECINST merge vecName ?vecName ...?

Parameters

vecName:

Input vector.

Description

For vectors a={1 2} and b={10 20}, merging a b produces:

1 10 2 20

Return value

Nothing.

VECINST normalize

Normalizes real vector values to the range 0.0 through 1.0 using:

VECINST normalize vecName

Parameters

`(value:

Minimum) / (maximum - minimum)``. This operation is not supported for complex vectors because complex values have no natural minimum/maximum ordering. With no destination vector, returns the normalized values as a Tcl list. If``vecName` is supplied, that vector is created or resized and the normalized values are stored there.

vecName:

Optional destination vector.

Return value

Normalized list when no destination is specified; otherwise nothing.

VECINST offset

Queries or changes the external index offset of the vector. The offset changes the numeric indices through which the vector is addressed without moving the underlying data.

VECINST offset offset

Parameters

offset:

New Tcl-sized integer offset.

Return value

Current offset.

VECINST populate

Creates a more densely sampled vector using linear interpolation. density intermediate values are inserted between every adjacent pair of source values. density must be at least 1. The destination may be the same vector as the source and has the same numeric type as the source. For complex vectors, the real and imaginary components are linearly interpolated independently.

VECINST populate vecName density

Parameters

vecName:

Destination vector.

density:

Number of interpolated values inserted between each pair.

Return value

Nothing.

VECINST random

Fills the vector with pseudo-random data while preserving its current length. For real vectors, one random value in the range [0.0, 1.0) is generated for each vector value. For complex vectors, the real and imaginary components are generated independently in that range.

VECINST random

Description

An empty vector remains empty.

Return value

Nothing.

VECINST range

Gives back an inclusive range of vector values. If first is less than or equal to last, values are returned in ascending index order. If first is greater than last, values are returned in descending index order. first and last are normal vector indices and may use forms such as end. This operation does not modify the vector.

VECINST range first last

Parameters

first:

First vector index.

last:

Last vector index.

Description

Example:

x set {10 20 30 40 50}

x range 1 3
# -> 20.0 30.0 40.0

x range 3 1
# -> 40.0 30.0 20.0

Return value

A list containing the selected vector values.

VECINST seq

Generates an arithmetic sequence.

VECINST seq start end ?step?

Parameters

end:

End value or literal end.

start:

First value.

step:

Optional increment.

Description

For a real vector, sequence generation follows the normal scalar arithmetic sequence rules. For a complex vector, start, end, and step may be {real imag} values or real scalars. The real and imaginary components progress independently:

z[i].real = start.real + step.real * i
z[i].imag = start.imag + step.imag * i

With an explicit complex end value, every changing component must generate the same number of values. A component whose step is zero must have identical start and end components. An explicitly zero complex step {0 0} is invalid.

If end is the literal end, the vector keeps its current length and is filled from start. In this form {0 0} is permitted and fills the vector with a constant value.

The default step is 1 for real vectors and {1 0} for complex vectors.

Return value

Nothing.

VECINST set

Replaces the contents of the vector. list may be a Tcl list of numeric values or the name of another vector. When the argument names another vector, the source and destination vector types must match. For a complex destination, list elements may be {real imag} values or real scalars.

VECINST set list

Parameters

list:

Numeric list or vector name.

Return value

Nothing.

VECINST sort

Sorts this real vector. Additional real vectors may be supplied as secondary sort keys. All vectors must have the same length.

VECINST sort ?-reverse? ?vecName ...?

Parameters

Description

Values are compared lexicographically: this vector is the primary sort key, the first additional vector breaks ties in the primary vector, the next vector breaks any remaining ties, and so on. The resulting permutation is applied to every participating vector.

-reverse reverses the resulting sort order.

Complex vectors cannot participate as either the primary or an additional sort vector because no natural ordering relation is defined for complex values.

-reverse:

Sort in descending order.

vecName:

Optional additional real vector used as a successive sort key and reordered using the same permutation.

Return value

Nothing.

VECINST split

Distributes values from this vector among destination vectors in round-robin order. The source vector length must be evenly divisible by the number of destination vectors. Existing destination contents are preserved and the split values are appended. Destination vectors have the same numeric type as the source vector.

VECINST split ?vecName ...?

Parameters

vecName:

Destination vector.

Description

For example, splitting:

{1 10 2 20 3 30}

into vectors x and y appends {1 2 3} to x and {10 20 30} to y.

Return value

Nothing.

VECINST type

Returns the immutable numeric type of the vector. real or complex.

VECINST type

Return value

Returns the immutable numeric type of the vector. real or complex.

VECINST variable

Queries or changes the Tcl array variable associated with the vector. Supplying an empty variable name removes the current mapping. Real vectors normally receive an automatic array mapping at creation. Complex vectors do not receive an automatic mapping, but an explicit mapping is supported. Ordinary complex array elements use {real imag} representation. The calculated array indices min, max, mean, sum, and prod are not supported for complex vectors.

VECINST variable varName

Parameters

varName:

Optional Tcl array variable name.

Return value

Name of the currently mapped variable, or an empty result if no variable is mapped.

vector

A command ensemble.

vector subcommand ...

Description

The ensemble supports the following subcommands:

create

Creates one or more vectors.

destroy

Destroys one or more vectors. Destroying a vector removes its associated vector instance command and Tcl array variable and notifies clients that use the vector.

expr

Evaluates a vector expression. expression may contain scalars, vectors, vector ranges, arithmetic operators, and the vector mathematical functions described in Vector expressions. Unlike the instance VECINST expr operation, this command does not store the result in an existing vector.

names

Gives back the names of existing vectors. If pattern is supplied, only vector names matching the Tcl glob pattern are returned.

Refer to the documentation of each subcommand for details.

vector create

Creates one or more vectors.

vector create vecName ?vecName ...? ?switch value ...?

Parameters

-command commandName:

Sets the Tcl command associated with the vector. This option can only be used when creating one vector.

-flush boolean:

If true, cached entries in an associated Tcl array are flushed whenever the vector is modified.

-length size:

Sets the initial length when no size is included in the vector specification. size must be zero or greater.

-type type:

Selects the numeric vector type. type must be real or complex. The default for a new vector is real. The option applies to every vector named by the command. A vector’s type cannot be changed after creation.

-variable varName:

Sets the Tcl array variable associated with the vector. This option can only be used when creating one vector. Real vectors receive an automatic array mapping when this option is omitted. Complex vectors do not receive an automatic array mapping, but an explicit mapping is supported.

-watchunset boolean:

If true, unsetting the complete associated array variable destroys the vector.

vecName:

Vector name or vector specification. A specification may have the form name, name(size), or name(first:last).

Description

Example:

::rbc::vector create x
::rbc::vector create y(100)
::rbc::vector create z(-10:10)
::rbc::vector create c -type complex
set v [::rbc::vector create #auto]

Return value

The name of the last vector created.

vector destroy

Destroys one or more vectors. Destroying a vector removes its associated vector instance command and Tcl array variable and notifies clients that use the vector.

vector destroy vecName ?vecName ...?

Parameters

vecName:

Name of a vector to destroy.

Return value

Nothing.

vector expr

Evaluates a vector expression. expression may contain scalars, vectors, vector ranges, arithmetic operators, and the vector mathematical functions described in Vector expressions. Unlike the instance VECINST expr operation, this command does not store the result in an existing vector.

vector expr expression

Parameters

expression:

Vector expression to evaluate.

Return value

The scalar value or list of vector values produced by the expression.

vector names

Gives back the names of existing vectors. If pattern is supplied, only vector names matching the Tcl glob pattern are returned.

vector names pattern

Parameters

pattern:

Optional Tcl glob pattern.

Return value

A list of vector names.

winop

A command ensemble.

winop subcommand ...

Description

The ensemble supports the following subcommands:

changes

Realizes a Tk window if necessary. For a toplevel window, also requests backing-store and save-under attributes from the underlying window system.

colormap

Gives back information about color cells in the colormap associated with a Tk window. This operation is available only on non-Windows builds and examines up to 256 colormap entries.

convolve

Applies a two-dimensional convolution kernel to a Tk photo image. filter must be a non-empty square list of finite numeric values. The output has the same dimensions as the source photo. The source and destination may be the same image.

image

Dispatches grouped image-processing operations. See WINOPIMAGE for the available subcommands.

lower

Lowers one or more Tk windows to the bottom of their stacking order. Supplying no window names has no effect.

map

Maps one or more windows through the underlying window system. Tk path names are the portable form of window identifier. Supplying no windows has no effect.

move

Moves a Tk window to the specified coordinates using Tk’s window-moving operation. x and y are parsed as Tk screen distances.

quantize

Reduces the number of colors in a Tk photo image. nColors must be between 1 and 256. If omitted it defaults to 1. The destination is resized to the source dimensions when necessary.

query

Gives back the current pointer location in root-screen coordinates.

raise

Raises one or more Tk windows to the top of their stacking order. Supplying no window names has no effect.

readjpeg

Reads a JPEG file into an existing Tk photo image. The operation returns an error if JPEG support was not compiled into Rbc.

resample

Copies or resamples a source photo into a destination photo. The destination’s existing dimensions determine the requested output size. One filter is used in both directions; two filters independently select horizontal and vertical filtering. With no filter, none is used. See Image resampling.

snap

Captures a window into an existing Tk photo image. Optional positive width and height values request a resampled output size. If either dimension is omitted, the corresponding window dimension is used.

subsample

Extracts a rectangular source region and copies or resamples it into a destination photo. x and y must be non-negative, while width and height must be positive. The region must lie completely inside the source image. The default filter is box. See Subsampling.

unmap

Unmaps one or more windows through the underlying window system. Tk path names are the portable form of window identifier. Supplying no windows has no effect.

warpto

Queries or changes the pointer position. With no argument, returns the current root-screen position. An @x,y argument moves the pointer to those root-screen coordinates. A Tk window pathname moves the pointer to the center of that window, which must be mapped. The resulting pointer position is returned.

Refer to the documentation of each subcommand for details.

winop changes

Realizes a Tk window if necessary. For a toplevel window, also requests backing-store and save-under attributes from the underlying window system.

winop changes window

Parameters

window:

Path name of the Tk window.

Return value

Nothing.

winop colormap

Gives back information about color cells in the colormap associated with a Tk window. This operation is available only on non-Windows builds and examines up to 256 colormap entries.

winop colormap window

Parameters

window:

Path name of the Tk window.

Return value

A flat list of color and pixel-value pairs in the form color pixel color pixel ....

winop convolve

Applies a two-dimensional convolution kernel to a Tk photo image. filter must be a non-empty square list of finite numeric values. The output has the same dimensions as the source photo. The source and destination may be the same image.

winop convolve srcPhoto destPhoto filter

Parameters

srcPhoto:

Source Tk photo image.

destPhoto:

Destination Tk photo image.

filter:

Square list of convolution-kernel values.

Return value

Nothing.

winop image

Dispatches grouped image-processing operations. See WINOPIMAGE for the available subcommands.

winop image subcommand ?arg ...?

Parameters

subcommand:

Image operation.

Return value

Result of the selected image operation.

winop lower

Lowers one or more Tk windows to the bottom of their stacking order. Supplying no window names has no effect.

winop lower ?window ...?

Parameters

window:

Path name of a Tk window.

Return value

Nothing.

winop map

Maps one or more windows through the underlying window system. Tk path names are the portable form of window identifier. Supplying no windows has no effect.

winop map ?window ...?

Parameters

window:

Window to map.

Return value

Nothing.

winop move

Moves a Tk window to the specified coordinates using Tk’s window-moving operation. x and y are parsed as Tk screen distances.

winop move window x y

Parameters

window:

Path name of the Tk window.

x:

New horizontal position.

y:

New vertical position.

Return value

Nothing.

winop quantize

Reduces the number of colors in a Tk photo image. nColors must be between 1 and 256. If omitted it defaults to 1. The destination is resized to the source dimensions when necessary.

winop quantize srcPhoto destPhoto ?nColors?

Parameters

srcPhoto:

Source Tk photo image.

destPhoto:

Destination Tk photo image.

nColors:

Optional maximum number of colors.

Return value

Nothing.

winop query

Gives back the current pointer location in root-screen coordinates.

winop query

Return value

Pointer position in the form @x,y, or an empty result if the underlying pointer query fails.

winop raise

Raises one or more Tk windows to the top of their stacking order. Supplying no window names has no effect.

winop raise ?window ...?

Parameters

window:

Path name of a Tk window.

Return value

Nothing.

winop readjpeg

Reads a JPEG file into an existing Tk photo image. The operation returns an error if JPEG support was not compiled into Rbc.

winop readjpeg fileName photoName

Parameters

fileName:

JPEG file to read.

photoName:

Destination Tk photo image.

Return value

Nothing.

winop resample

Copies or resamples a source photo into a destination photo. The destination’s existing dimensions determine the requested output size. One filter is used in both directions; two filters independently select horizontal and vertical filtering. With no filter, none is used. See Image resampling.

winop resample srcPhoto destPhoto ?horzFilter? ?vertFilter?

Parameters

srcPhoto:

Source Tk photo image.

destPhoto:

Destination Tk photo image.

horzFilter:

Optional horizontal resampling filter.

vertFilter:

Optional vertical resampling filter.

Return value

Nothing.

winop snap

Captures a window into an existing Tk photo image. Optional positive width and height values request a resampled output size. If either dimension is omitted, the corresponding window dimension is used.

winop snap window photoName ?width? ?height?

Parameters

window:

Window to capture.

photoName:

Destination Tk photo image.

height:

Optional positive output height.

width:

Optional positive output width.

Return value

Nothing.

winop subsample

Extracts a rectangular source region and copies or resamples it into a destination photo. x and y must be non-negative, while width and height must be positive. The region must lie completely inside the source image. The default filter is box. See Subsampling.

winop subsample srcPhoto destPhoto x y width height ?horzFilter? ?vertFilter?

Parameters

srcPhoto:

Source Tk photo image.

destPhoto:

Destination Tk photo image.

x:

Horizontal source-region origin.

y:

Vertical source-region origin.

width:

Source-region width.

height:

Source-region height.

horzFilter:

Optional horizontal resampling filter.

vertFilter:

Optional vertical resampling filter.

Return value

Nothing.

winop unmap

Unmaps one or more windows through the underlying window system. Tk path names are the portable form of window identifier. Supplying no windows has no effect.

winop unmap ?window ...?

Parameters

window:

Window to unmap.

Return value

Nothing.

winop warpto

Queries or changes the pointer position. With no argument, returns the current root-screen position. An @x,y argument moves the pointer to those root-screen coordinates. A Tk window pathname moves the pointer to the center of that window, which must be mapped. The resulting pointer position is returned.

winop warpto ?window?

Parameters

window:

Optional mapped Tk window pathname or root-screen position of the form @x,y.

Return value

Current pointer position in the form @x,y.

WINOPIMAGE

A command ensemble.

WINOPIMAGE subcommand ...

Description

The ensemble supports the following subcommands:

convolve

Applies a two-dimensional convolution kernel to a Tk photo image. This is the grouped form of winop convolve.

gradient

Generates a gradient directly into an existing Tk photo image. left and right are Tk colors. type may be linear, radial, rectangular, or blank. The current dimensions of photo determine the generated image size.

readjpeg

Reads a JPEG file into an existing Tk photo image. This is the grouped form of winop readjpeg.

resample

Copies or resamples a source photo into a destination photo. This is the grouped form of winop resample.

rotate

Rotates a Tk photo image by a finite angle expressed in degrees. angle may be a Tcl numeric expression. The destination photo is resized to contain the rotated result.

snap

Captures a window into an existing Tk photo image. This is the grouped form of winop snap.

subsample

Extracts and optionally resamples a rectangular region of a source photo. This is the grouped form of winop subsample.

Refer to the documentation of each subcommand for details.

WINOPIMAGE convolve

Applies a two-dimensional convolution kernel to a Tk photo image. This is the grouped form of winop convolve.

WINOPIMAGE convolve srcPhoto destPhoto filter

Parameters

srcPhoto:

Source Tk photo image.

destPhoto:

Destination Tk photo image.

filter:

Square list of convolution-kernel values.

Return value

Nothing.

WINOPIMAGE gradient

Generates a gradient directly into an existing Tk photo image. left and right are Tk colors. type may be linear, radial, rectangular, or blank. The current dimensions of photo determine the generated image size.

WINOPIMAGE gradient photo left right type

Parameters

photo:

Tk photo image to modify.

left:

First gradient color.

right:

Second gradient color.

type:

Gradient type.

Return value

Nothing.

WINOPIMAGE readjpeg

Reads a JPEG file into an existing Tk photo image. This is the grouped form of winop readjpeg.

WINOPIMAGE readjpeg fileName photoName

Parameters

fileName:

JPEG file to read.

photoName:

Destination Tk photo image.

Return value

Nothing.

WINOPIMAGE resample

Copies or resamples a source photo into a destination photo. This is the grouped form of winop resample.

WINOPIMAGE resample srcPhoto destPhoto ?horzFilter? ?vertFilter?

Parameters

srcPhoto:

Source Tk photo image.

destPhoto:

Destination Tk photo image.

horzFilter:

Optional horizontal resampling filter.

vertFilter:

Optional vertical resampling filter.

Return value

Nothing.

WINOPIMAGE rotate

Rotates a Tk photo image by a finite angle expressed in degrees. angle may be a Tcl numeric expression. The destination photo is resized to contain the rotated result.

WINOPIMAGE rotate srcPhoto destPhoto angle

Parameters

srcPhoto:

Source Tk photo image.

destPhoto:

Destination Tk photo image.

angle:

Rotation angle in degrees.

Return value

Nothing.

WINOPIMAGE snap

Captures a window into an existing Tk photo image. This is the grouped form of winop snap.

WINOPIMAGE snap window photoName ?width? ?height?

Parameters

window:

Window to capture.

photoName:

Destination Tk photo image.

height:

Optional positive output height.

width:

Optional positive output width.

Return value

Nothing.

WINOPIMAGE subsample

Extracts and optionally resamples a rectangular region of a source photo. This is the grouped form of winop subsample.

WINOPIMAGE subsample srcPhoto destPhoto x y width height ?horzFilter? ?vertFilter?

Parameters

srcPhoto:

Source Tk photo image.

destPhoto:

Destination Tk photo image.

x:

Horizontal source-region origin.

y:

Vertical source-region origin.

width:

Source-region width.

height:

Source-region height.

horzFilter:

Optional horizontal resampling filter.

vertFilter:

Optional vertical resampling filter.

Return value

Nothing.


Copyright (c) George Yashin