# Difference between revisions of "ApCoCoA-1:GnuPlot.Plot"

From ApCoCoAWiki

Line 9: | Line 9: | ||

<itemize> | <itemize> | ||

− | <item>@param <em>Data</em> A list containing the description of the graphs to be plotted simultaneously. One of these data elements is composed of a list with three entries. The first entry is the actual data. The second entry is a string that selects the color used for drawing the graph (e.g. | + | <item>@param <em>Data</em> A list containing the description of the graphs to be plotted simultaneously. One of these data elements is composed of a list with three entries. The first entry is the actual data. The second entry is a string that selects the color used for drawing the graph (e.g. <quotes>green</quotes>, <quotes>yellow</quotes>, ...) and the third entry specifies the key which will be displayed in the drawing. The actual data can be a list of points or a polynomial/ rational function in the variables x and y.</item> |

<item>@param <em>NumVars</em> The number of variables; can either be 1 or 2.</item> | <item>@param <em>NumVars</em> The number of variables; can either be 1 or 2.</item> | ||

</itemize> | </itemize> | ||

Line 15: | Line 15: | ||

<example> | <example> | ||

--Plots some points in red | --Plots some points in red | ||

− | GnuPlot.Plot([[[[1,1],[2,2],[3,3]], | + | GnuPlot.Plot([[[[1,1],[2,2],[3,3]],<quotes>red</quotes>,<quotes>Graph 1</quotes>]],1); |

--Plots the graph of two polynomials | --Plots the graph of two polynomials | ||

− | GnuPlot.Plot([[x^2+x+1, | + | GnuPlot.Plot([[x^2+x+1,<quotes>red</quotes>,<quotes>Graph 1</quotes>],[-3x^2-x-2,<quotes>blue</quotes>,<quotes>Graph 2</quotes>]],1); |

--Plots a rational function in 3D | --Plots a rational function in 3D | ||

− | GnuPlot.Plot([[x^2+x+1/x^2y^2, | + | GnuPlot.Plot([[x^2+x+1/x^2y^2,<quotes>red</quotes>,<quotes>Graph 1</quotes>]],2); |

</example> | </example> | ||

</description> | </description> |

## Revision as of 12:39, 27 April 2009

## GnuPlot.Plot

Tries to plot the given data.

### Syntax

GnuPlot.Plot(Data:LIST, NumVars:INT)

### Description

This function tries to plot the input using Gnu Plot.

@param

*Data*A list containing the description of the graphs to be plotted simultaneously. One of these data elements is composed of a list with three entries. The first entry is the actual data. The second entry is a string that selects the color used for drawing the graph (e.g. "green", "yellow", ...) and the third entry specifies the key which will be displayed in the drawing. The actual data can be a list of points or a polynomial/ rational function in the variables x and y.@param

*NumVars*The number of variables; can either be 1 or 2.

#### Example

--Plots some points in red GnuPlot.Plot([[[[1,1],[2,2],[3,3]],<quotes>red</quotes>,<quotes>Graph 1</quotes>]],1); --Plots the graph of two polynomials GnuPlot.Plot([[x^2+x+1,<quotes>red</quotes>,<quotes>Graph 1</quotes>],[-3x^2-x-2,<quotes>blue</quotes>,<quotes>Graph 2</quotes>]],1); --Plots a rational function in 3D GnuPlot.Plot([[x^2+x+1/x^2y^2,<quotes>red</quotes>,<quotes>Graph 1</quotes>]],2);