Plotter:
Filter:
Classes | GUI > Accessories

Plotter : Object

Plot numerical data on a window or view
Source: PlotView.sc

Description

Plot data of up to three dimensions on a Window or UserView.

Keyboard shortcuts

When the plotter window has focus, the following keyboard shortcuts can be used to change the display:

+ / - vertical zoom
= compare plot channels
n toggle normalize display (0..1) / (-1..1), or fit range
s toggle superposition (see: superpose)
m switch plot mode (see: Plotter: -plotMode)
e toggle editing (see: Plotter: -editMode)
g toggle horizontal (domain) grid
G toggle vertical (codomain) grid
p print curve
ctrl-+ / - zoom font
alt-click post value

Method extensions

Plotter extends other classes with methods. To see what classes implements plot, see Methods: plot

plot(args)

plotGraph(n,from,to,...)

Class Methods

Plotter.new(name, bounds, parent)

Arguments:

name

Plot window title.

bounds

The window bounds (a Rect).

parent

Either a Window / View may be passed in - then the plot is embedded. Otherwise a new Window is created.

Discussion:

Inherited class methods

Instance Methods

Accessing Instance Variables

.makeWindow(argParent, argBounds)

Open given plotter in a new window or within a given composite view.

Arguments:

argParent

Either a Window or View may be passed in - then the plot is embedded. Otherwise a new Window is created.

argBounds

The window bounds (a Rect).

.plotMode

.plotMode = value

Set the style of data display.

Arguments:

(symbol)

Available modes:

\linear connecting data points with linear interpolation
\points draw data points only
\plines combination of lines and points
\levels horizontal lines
\steps connecting data points with step interpolation
\bars bar graph with filled bars

Discussion:

.setProperties( ... pairs)

Set properties of all plot views. Defaults are taken from GUI.skin.at(\plot);

Arguments:

... pairs

A list of symbol,value pairs. Supported properties:

  • font
  • fontColor
  • gridColorX
  • gridColorY
  • plotColor (an Array)
  • backgroundColor
  • gridLinePattern
  • gridLineSmoothing ( Boolean )
  • labelX
  • labelY
  • gridOnX ( Boolean )
  • gridOnY ( Boolean )

Discussion:

Example:

.editMode

.editMode = value

If the edit mode is set to true, the data may be edited via cursor.

.resolution

.resolution = value

Set the number of data points displayed maximally per pixel (default: 1)

.findSpecs

.findSpecs = value

If true (default: true), specs are derived from new data (using min and max values) automatically.

.superpose

.superpose = flag

If set to true, plotter displays channels on top of each other (keyboard shortcut: s)

.value

.value = arrays

Return or set the data values. Data may be numerical arrays of up to 3 dimensions.

.data

Reference to the current internal data.

.cursorPos

Returns:

the last cursorPos (a Point).

.plots

Returns:

the single subplots (a Plot).

.specs

.specs = argSpecs

Set or get the spec for the y-axis (codomain).

.domainSpecs

.domainSpecs = argSpecs

Set or get the spec for the x-axis (domain).

.editFunc

.editFunc = value

Supply a function which is evaluated when editing data. The function is called with the arguments: plotter, plotIndex, index, val, x, y.

Discussion:

Example:

Inherited instance methods

Undocumented instance methods

.bounds

.bounds = value

.calcDomainSpecs

.calcSpecs(separately: true, minval, maxval, defaultRange)

.domain

.domain = value

.draw

.drawBounds

.drawFunc

.drawFunc = value

.editData(x, y)

.editPlotIndex

.editPos

.getDataPoint(x, y)

.gui

.interactionView

.makePlots

.maxval = val

.minval = val

.name

.name = value

.normalized

.normalized = value

.numChannels

.numFrames

.parent

.parent = value

.pointIsInWhichPlot(point)

.postCurrentValue(x, y)

.prReshape(item)

.print

.refresh

.setValue(arrays, findSpecs: true, refresh: true, separately: true, minval, maxval, defaultRange)

.updatePlotBounds

.updatePlotSpecs

.updatePlots

Examples

Changing global defaults

The default styles are kept (and may be overridden) in GUI.skin.at(\plot). See also GUI help.