## Name:

plot plots one or several functions

## Usage:

plot(f1, ... ,fn, I) : (function, ... ,function, range) -> void plot(f1, ... ,fn, I, file, name) : (function, ... ,function, range, file, string) -> void plot(f1, ... ,fn, I, postscript, name) : (function, ... ,function, range, postscript, string) -> void plot(f1, ... ,fn, I, postscriptfile, name) : (function, ... ,function, range, postscriptfile, string) -> void plot(L, I) : (list, range) -> void plot(L, I, file, name) : (list, range, file, string) -> void plot(L, I, postscript, name) : (list, range, postscript, string) -> void plot(L, I, postscriptfile, name) : (list, range, postscriptfile, string) -> void

## Parameters:

• f1, ..., fn are functions to be plotted.
• L is a list of functions to be plotted.
• I is the interval where the functions have to be plotted.
• name is a string representing the name of a file.

## Description:

• This command plots one or several functions f1, ... ,fn on an interval I. Functions can be either given as parameters of plot or as a list L which elements are functions. The functions are drawn on the same plot with different colors.
• If L contains an element that is not a function (or a constant), an error occurs.
• plot relies on the value of global variable points. Let n be the value of this variable. The algorithm is the following: each function is evaluated at n evenly distributed points in I. At each point, the computed value is a faithful rounding of the exact value with a sufficiently high precision. Each point is finally plotted. This should avoid numerical artefacts such as critical cancellations.
• You can save the function plot either as a data file or as a postscript file.
• If you use argument file with a string name, Sollya will save a data file called name.dat and a gnuplot directives file called name.p. Invoking gnuplot on name.p will plot the data stored in name.dat.
• If you use argument postscript with a string name, Sollya will save a postscript file called name.eps representing your plot.
• If you use argument postscriptfile with a string name, Sollya will produce the corresponding name.dat, name.p and name.eps.
• This command uses gnuplot to produce the final plot. If your terminal is not graphic (typically if you use Sollya through ssh without -X) gnuplot should be able to detect that and produce an ASCII-art version on the standard output. If it is not the case, you can either store the plot in a postscript file to view it locally, or use asciiplot command.
• If every function is constant, plot will not plot them but just display their value.
• If the interval is reduced to a single point, plot will just display the value of the functions at this point.

## Example 1:

> plot(sin(x),0,cos(x),[-Pi,Pi]);

## Example 2:

> plot(sin(x),0,cos(x),[-Pi,Pi],postscriptfile,"plotSinCos");

## Example 3:

> plot(exp(0), sin(1), [0;1]);
1
0.84147098480789650665250232163029899962256306079837

## Example 4:

> plot(sin(x), cos(x), [1;1]);
0.84147098480789650665250232163029899962256306079837
0.54030230586813971740093660744297660373231042061792