[ top | up ]

Draw Function Plots

Syntax

curve(expr, from, to, n=100, ...)

Arguments

expr an expression, written as a function of x which will be plotted.
from,to the range over which the function will be plotted.
n the expression will be evaluated at n points equally spaced over the range [from, to]. The points determined in this way are then joined with straight lines.
... graphical parameters can also be specified as arguments.

Value

This function draws a curve corresponding to the given expression (in x) over the interval [from,to]. It is a quick hack which seems to serve a useful purpose, but can give bad results for functions which are discontinuous.

Examples

curve(x^3-3*x, -2, 2)