plot
Plot the data
Syntax
y = plot ( x,y[=""],opt[=""] )
y = plot ( handle,x,y[=""],opt[=""] )
y = handle.plot ( x,y[=""],opt[=""] )
Inputs
| Argument | Type | Description | Unit |
|---|---|---|---|
handle | graphics handle | handle to the figure window or the axes | n/a |
x | VECT or audio | x-data | - |
y | VECT or audio | y-data | - |
opt | text | plot option string--specifying color marker and line style (see notes) | - |
Outputs / Return Value
y:yis the handle to the line object
Notes
- If
handleis omitted, this function creates a new figure window and plots - If
yis specified,yis plotted as a function ofx. - If
yis omitted,xis plotted with the index (if non-audio) or the time (if audio) on the x-axis. optis a text not exceeding 4 characters specifying the color, the marker type and the line style. Color: r(ed) g(reen) b(lue) y(ellow) c(yan) m(agenta) h(white) (blac)k Marker: o circle s square . point * asterisk x cross + plussign d diamond ^ upward-pointingtriangle v downward-pointingtriangle > right-pointingtriangle < left-pointingtriangle Linestyle: - solid : dotted -- dashed -. dash-dot- The default marker type is . (point)
- The default line style is solid, but if only the marker type is specified, the line style will become none (i.e., in order to make the line tyle none, specify ".")
- The default color is blue
- All the other graphic properties can be directly manipulated with the relevant member variables.
Examples
plot(x) // plot x with the default parameters
plot(x,y) // plot y as a function of x with the default parameters
plot(x,"r") // plot x with the red line
plot(x,"o") // plot x with the marker "o" and no line
plot(x,"*":) // plot x with the marker "*" and dotted line
plot(x,y,"o") // plot y as a function of x with the marker "o" and no line
plot(x,y,"*:") // plot y as a function of x with the marker "*" and dotted line
plot(h,x) // plot x in h (either a figure window handle or axes handle)
plot(h,x,y)
plot(h,x,y,"r")
See Also
Review Status
- Legacy parameter naming does not exactly match current engine metadata and should be reviewed manually.