graph
Creates a graph of a function D → ℝ where D ⊂ ℝⁿ.
Syntax
-
graph(f, a, b[, δ])-
fis a function D → ℝ with D ⊂ ℝ -
ais an element ofD -
bis an element ofD -
δis a non-negative real number
-
-
graph(f, ❨a1, b1[, δ1]❩, ..., ❨an, bn[, δn]❩)-
fis a function D → ℝ with D ⊂ ℝⁿ -
a1, ...,anare real numbers -
b1, ...,bnare real numbers -
δ1, ...,δnare non-negative real numbers
-
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⋅π))