Previous Up Next

3.2.1  2-d graph

plotfunc(f(x),x) draws the graph of y=f(x) for x in the default interval, plotfunc(f(x),x=a..b) draws the graph of y=f(x) for axb. plotfunc accepts an optional xstep=... argument to specify the discretisation step in x.
Input :

plotfunc(x^2-2)

or

plotfunc(a^2-2,a=-1..2)

Output :

the graph of y=x^2-2

Input :

plotfunc(x^2-2,x,xstep=1)

Output :

a polygonal line which is a bad representation of y=x^2-2

It is also possible to specify the number of points used for the representation of the function with nstep= instead of xstep=. For example, input :

plotfunc(x^2-2,x=-2..3,nstep=30)

Previous Up Next