Back to Data Visualization
plot
2-D line plot
Syntax
plot(y) plot(x, y)
Description
Creates a line chart. Successive plot() calls add datasets to the same chart; call figure to start a new chart. If one argument is given, it is treated as y-values with x = 1:n. With two arguments, x and y are paired.
Parameters
| Name | Description |
|---|---|
| x(optional) | X-axis data (NDArray or scalar) |
| y | Y-axis data (NDArray or scalar) |
Returns
null (renders chart inline)
Examples
Try It
>> x = linspace(0, 2*pi, 50); plot(x, sin(x))