Algosim documentation: LinePlot

LinePlot

Creates an XY line plot (or line chart).

Syntax

Description

If data is a sequence of (X, Y) points, then LinePlot(data) creates a line plot from this data.

Technically, data can be a plain sequence of points as function arguments, a list of points, or an n×2 real matrix in which each row represents a single point.

The chart is shown in the current diagram and a reference to the chart is returned.

To plot the graph of a function using line segments, you may combine LinePlot with the graph function. But it is more convenient to use plot instead.

LineChart is a synonym for LinePlot.

Examples

LinePlot(❨1, 1❩, ❨2, 5❩, ❨3, −2❩)

or

LinePlot('(❨1, 1❩, ❨2, 5❩, ❨3, −2❩))

Image 1

A ≔ ❨❨1, 1❩, ❨2, 5❩, ❨3, −2❩❩
⎛ 1   1⎞
⎜ 2   5⎟
⎝ 3  −2⎠
LinePlot(A)

Image 2

LinePlot(graph(sin, −2⋅π, 2⋅π))

Image 3

AdjustVisual(ans, "line color": "red", "line width": 3)

Image 4

See also