Algosim documentation: graph

graph

Creates a graph of a function D → ℝ where D ⊂ ℝⁿ.

Syntax

Description

graph(f, a, b, δ) returns the graph of f from a to b with resolution (step size) δ if δ > 0; if δ = 0 or δ is not specified, a default resolution is used.

graph(f, ❨a1, b1[, δ1]❩, ..., ❨an, bn[, δn]❩) returns the graph of f on [a1, b1] × ⋯ × [an, bn] with resolution (step size) δk in the kth dimension, assuming δk > 0; if δk is zero or not specified, a default resolution is used for that dimension.

The result is a matrix containing the points of the graph, one per line.

The graph function can be combined with one of ScatterPlot, LinePlot, or AreaChart to visualise a function’s graph. However, using the plot function alone is more convenient.

Examples

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

Image 1

See also