A newer version of Max is available. Click here to access the latest version of the documentation

plot~ Reference

Visualize two-dimensional data

plot~

Description

Use the plot~ object to graph sets of data as points across a domain. The source of the data to be visualized may be a Max list, an MSP buffer~, or an audio signal. The number of plots may be changed with the @numplots attribute, and each of these "subplots" is addressed through a dedicated inlet. A variety of out-of-the-box configurations are provided as Max object prototypes.

Arguments

None.

Attributes

applyfont [int] (default: 0)

When applyfont is enabled, the current fontname and fontsize apply to all text labels drawn by plot~. When applyfont is disabled, the fontname and fontsize are used only for the domain and range labels (set by the domainlabel and rangelabel attributes).

audioframerate [float] (default: 15.)

Speed for display update when a plot~ is visualizing an audio signal. The drawing for such cases is driven by a clock operating at the specified number of frames per second.

audioframesize [atom_long] (default: 0)

Number of samples collected from audio input to create a single frame of data. By default, audio signals will be visualized by collecting sample values until the number of points in the plot is full (audioframesize=0). Then all points will be updated and drawn. An alternate audioframesize value must be greater than the value of the numpoints attribute.

In some cases it is desirable to collect a larger set of samples and then visualize only a portion of those samples. To visualize the output of an FFT, for example, it is often desirable to only view either the first or second half of a frame because they are mirror images of each other. By setting the audioframesize, the number of points in @audioframesize will be collected, and only the first @numpoints will actually be drawn.

bgcolor [4 floats] (default: 1. 1. 1. 1.)

Background color

domainlabel [symbol] (default: )

Bottom (horizontal) text

fontname [symbol] (default: Lato)

The fontname attribute sets the font for the domain and range label. If applyfont is enabled, it also applied to all text shown by the object.

fontsize [float] (default: 10.)

The fontsize attribute sets the font size for the domain and range label. If applyfont is enabled, it also applied to all text shown by the object.

gridcolor [4 floats] (default: 0.5 0.5 0.5 1.)

Sets the grid color in RGBA format.

gridorigincolor [4 floats] (default: 0. 0. 0. 1.)

Sets the grid color at the origin in RGBA format.

margins [4 floats] (default: 8. 8. 8. 8.)

Indent margins (top, right, bottom, and left)

numplots [int] (default: 1)

Number of data sets to be plotted. The object will grow/absorb inlets as needed. Each 'subplot' will be addressed through its dedicated inlet.

numpoints [int] (default: 4)

Sets the number of points to be displayed across the domain of all plots

rangelabel [symbol] (default: )

Left-hand (vertical) text

thinmode [symbol] (default: sample)

Data-thinning behavior when the size of the data set (number of points) exceeds the number of pixels available to display each point discretely. Possible values:

'none' ( All points will be drawn, and will overlap as needed )
'sample' ( Number of points will be reduced according to thinto prior to drawing )

thinthresh [int] (default: 10)

The point at which the thinmode is invoked to begin reducing the data set. By default this attribute is set to a value of 10, meaning that once there are 10 points being drawn at the same pixel location on the screen the thinmode will be invoked.

thinto [float] (default: 0.2)

Factor by which the data set is reduced when the thinmode is invoked. By default the factor is 0.2, which results in 5 values being overlapped at a given pixel location.

Common Box Attributes

annotation [symbol]

Sets the text that will be displayed in the Clue window when the user moves the mouse over the object.

background [int] (default: 0)

Adds or removes the object from the patcher's background layer. background 1 adds the object to the background layer, background 0 removes it. Objects in the background layer are shown behind all objects in the default foreground layer.

color [4 floats]

Sets the color for the object box outline.

fontface [int]

Sets the type style used by the object. The options are:

plain
bold
italic
bold italic Possible values:

0 = 'regular'
1 = 'bold'
2 = 'italic'
3 = 'bold italic'

fontname [symbol]

Sets the object's font.

fontsize [float]

Sets the object's font size (in points). Possible values:

'8'
'9'
'10'
'11'
'12'
'13'
'14'
'16'
'18'
'20'
'24'
'30'
'36'
'48'
'64'
'72'

hidden [int] (default: 0)

Toggles whether an object is hidden when the patcher is locked.

hint [symbol]

Sets the text that will be displayed in as a pop-up hint when the user moves the mouse over the object in a locked patcher.

ignoreclick [int] (default: 0)

Toggles whether an object ignores mouse clicks in a locked patcher.

jspainterfile [symbol]

JS Painter File

patching_rect [4 floats] (default: 0. 0. 100. 0.)

Sets the position and size of the object in the patcher window.

position [2 floats]

g/s(set)

Sets the object's x and y position in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its size unchanged.

presentation [int] (default: 0)

Sets whether an object belongs to the patcher's presentation.

presentation_rect [4 floats] (default: 0. 0. 0. 0.)

Sets the x and y position and width and height of the object in the patcher's presentation, leaving its patching position unchanged.

rect [4 floats]

g/s(set)

Sets the x and y position and width and height of the object in both patching and presentation modes (if the object belongs to its patcher's presentation).

size [2 floats]

g/s(set)

Sets the object's width and height in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its position unchanged.

textcolor [4 floats]

Sets the color for the object's text in RGBA format.

textjustification [int]

Sets the justification for the object's text. Possible values:

0 = 'left'
1 = 'center'
2 = 'right'

varname [symbol]

Sets the patcher's scripting name, which can be used to address the object by name in pattr, scripting messages to thispatcher, and the js object.

Messages

int

Arguments

input [int]
Set the first value of a subplot.

float

Arguments

input [float]
Set the first value of a subplot.

list

Arguments

numbers-to-plot [list]
Data set to be plotted across the domain. The inlet at which the list is received determines which subplot graphs the data. If the list is larger than the number of points in the plot, then the list will be truncated.

definecolor

Arguments

color [color]
Define the color used for drawing the subplot associated with the inlet at which the message is received. The order of the color components is red, green, blue, and alpha.

definedomain

Arguments

domain-start [number]
domain-end [number]
domain-style [symbol]
Define the domain for the subplot associated with the inlet at which the message is received. The number of actual points will not change, as that is set with the @numpoints attribute. This message sets the domain of numbers spanned by those points. For example, there may be 256 points representing a domain of [0.0, 1.0]. In this case the domain is essentially a label for the points. An optional third argument specifies 'linear' vs 'log' scaling of the domain.

definefilter

Arguments

filter-name [symbol]
Defines a filter to be applied to the data set before it is graphed. There are currently two options available ('none' and 'atodb').

defineline

Arguments

line-style [symbol]
Define the style used to display lines in the subplot associated with the inlet at which the message is received. Options are 'linear', 'lines', 'curve', 'origin', or 'none'.

While 'lines' will display more quickly than 'linear', the 'linear' option will look better in some cases (usually when working with high thickness values). The difference between the display styles is related to how line segments are joined at the elbows: 'lines' does nothing, while the 'linear' option makes smooth connections.

definenumber

Arguments

number-style [symbol]
Define the style used displaying numbers in the subplot associated with the inlet at which the message is received. Options are 'above', 'below', 'center', or 'none'.

definepoint

Arguments

point-style [symbol]
Define the style used to display points in the subplot associated with the inlet at which the message is received. Options are 'dot', 'circle', 'square', or 'none'.

definerange

Arguments

range-start [number]
range-end [number]
range-style [symbol]
Define the range for the subplot associated with the inlet at which the message is received. Values in the displayed data sets that are out of this range will be out of range of the plot drawing.

definethickness

Arguments

line-thickness [number]
Define the thickness of the lines for the subplot associated with the inlet at which the message is received. A thickness of 1 indicates a 1 'pixel' linewidth.

definexgrid

Arguments

x-axis-points [list]
Define the points along the domain at which a vertical marker-line should be drawn for the subplot associated with the inlet at which the message is received. The points along the domain should be within the range specified by the 'definedomain' message.

definexlabels

Arguments

pairs-of-points-and-labels [list]
Defines the labels for points along the domain for the subplot associated with the inlet at which the message is received. For each point that you wish to be labeled, you must provide a float-symbol pair defining the location in the domain (as defined using the 'definedomain' message) and the label for that location.

definexorigin

Arguments

origin [float]
Define the value across the domain to serve as the origin for the plot.

defineygrid

Arguments

y-axis-points [list]
Define the points along the range at which a horizontal marker-line should be drawn for the subplot associated with the inlet at which the message is received. The points along the range should be within the range specified by the 'definerange' message.

defineylabels

Arguments

pairs-of-points-and-labels [list]
Defines the labels for points along the range for the subplot associated with the inlet at which the message is received. For each point that you wish to be labeled, you must provide a float-symbol pair defining the location in the range (as defined using the 'definerange' message) and the label for that location.

defineyorigin

Arguments

origin [float]
Define the value within the range to serve as the origin for the plot. This will affect where lines originate when the line style is set to 'origin'.

dictionary

Arguments

dictionary-name [symbol]
Configure a subplot. The dictionary may contain the subplot's data, appearance, or both.

edit

Open a dictionary editor window for a subplot. After making edits to the plot, simply close the window and the changes will take effect.

getdictionary

Arguments

subplot-number [int]
Retrieve the state of a subplot. The returned dictionary will contain the subplot's complete state including both data and appearance configuration.

(mouse)

Send mouse position and behavior to the outlet

refer

Arguments

buffer-name [symbol]
channel-number [number]
start-time [number]
end-time [number]
Set the subplot for the given inlet to reference the data in a named buffer~ object. If a second argument is given to this message, it will determine the channel within the buffer~ that should be displayed. The third and fouth arguments set the start and end time of the buffer in milliseconds. If these arguments are not present, the entire buffer is used.

signal

Signal whose samples will be collected and used as the dataset to display. The samples will be collected into blocks that are the same size as the numpoints attribute unless an audioframesize has been defined.

Output

list

The 'mouse' message is sent together with normalized mouse coordinates and the mouse button state.

See Also

Name Description
filterdetail Detail the characteristics of a filter
scope~ Visualize an audio signal
multislider Display data as sliders or a scrolling display
waveform~ buffer~ viewer and editor
filtergraph~ Filter editor
spectroscope~ Signal spectrogram or sonogram
Audio Filtering Audio Filtering