File r37/lisp/csl/html/r37_0551.html artifact 3c7609aad5 part of check-in 58a25bf8df



<A NAME=PLOT>

<TITLE>PLOT</TITLE></A>
<b><a href=r37_idx.html>INDEX</a></b><p><p>



<B>PLOT</B> _ _ _  _ _ _  _ _ _  _ _ _ <B>command</B><P>
<P>
 
 <P>
<P>
The command <em>plot</em> is the main entry for drawing a 
picture from inside REDUCE. 
<P>
<P>
 <P> <H3> 
syntax: </H3>
<em>plot</em>(&lt;spec&gt;,&lt;spec&gt;,...) 
<P>
<P>
<P>
where &lt;spec&gt; is a &lt;function&gt;, a &lt;range&gt; or an &lt;option&gt;. 

<P>
<P>
&lt;function&gt;: 
<P>
<P>
- an expression depending 
on one unknown (e.g. <em>sin(x)</em> or two unknowns (e.g. 
<em>sin(x+y)</em>, 
<P>
<P>
- an equation with a function on its right-hand 
side and a single name on its left-hand side (e.g. 
<em>z=sin(x+y)</em> where the name on the left-hand side specifies 
the dependent variable. 
<P>
<P>
- a list of functions: 
if in 2 dimensions the picture should have more than one 
curve the expressions can be given as list (e.g. <em>{sin(x),cos(x)}</em>). 
<P>
<P>
- an equation with zero left or right hand side describing 
 an implicit curve in two dimensions (e.g. <em>x**3+x*y**3-9x=0</em>). 
<P>
<P>
- a point set: the graph can be given 
as point set in 2 dimensions or a 
<A HREF=r37_0550.html>pointset</A> or pointset list 
in 3 dimensions. 
<P>
<P>
&lt;range&gt;: 
<P>
<P>
Each dependent and independent variable can be limited 
to an interval by an equation where the left-hand side specifies 
the variable and the right-hand side defines the 
<A HREF=r37_0422.html>interval</A>, 
e.g. <em>x=( -3 .. 5)</em>. 
<P>
<P>
If omitted the independent variables 
range from -10 to 10 and the dependent variable is limited only 
by the precision of the IEEE floating point arithmetic. 
<P>
<P>
&lt;option&gt;: 
<P>
<P>
An option can be an equation equating a variable 
and a value (in general a string), or a keyword(GNUPLOT switch). 
These have to be included in the gnuplot command arguments directly. 
Strings have to be enclosed in 
string quotes (see 
<A HREF=r37_0003.html>string</A>). Available options are: 
<P>
<P>

<A HREF=r37_0553.html>title</A>: assign a heading (default: empty) 
<P>
<P>

<A HREF=r37_0554.html>xlabel</A>: set label for the x axis 
<P>
<P>

<A HREF=r37_0555.html>ylabel</A>: set label for the y axis 
<P>
<P>

<A HREF=r37_0556.html>zlabel</A>: set label for the z axis 
<P>
<P>

<A HREF=r37_0557.html>terminal</A>: select an output device 
<P>
<P>

<A HREF=r37_0558.html>size</A>: rescale the picture 
<P>
<P>

<A HREF=r37_0559.html>view</A>: set a viewpoint 
<P>
<P>
<em>(no)</em>
<A HREF=r37_0560.html>contour</A>: 3d: add contour lines 
<P>
<P>
<em>(no)</em>
<A HREF=r37_0561.html>surface</A>: 3d: draw surface (default: yes) 
<P>
<P>
<em>(no)</em>
<A HREF=r37_0562.html>hidden3d</A>: 3d: remove hidden lines (default: no) 
<P>
<P>
 <P> <H3> 
examples: </H3>
<P><PRE><TT>
plot(cos x);

plot(s=sin phi,phi=(-3 .. 3));

plot(sin phi,cos phi,phi=(-3 .. 3));

plot (cos sqrt(x**2 + y**2),x=(-3 .. 3),y=(-3 .. 3),hidden3d);

plot {{0,0},{0,1},{1,1},{0,0},{1,0},{0,1},{0.5,1.5},{1,1},{1,0}};



on rounded;

w:=for j:=1:200 collect {1/j*sin j,1/j*cos j,j/200}$

plot w; 
</TT></PRE><P>Additional control of the <em>plot</em> operation: 

<A HREF=r37_0564.html>plotrefine</A>, 

<A HREF=r37_0565.html>plot_xmesh</A>, 
<A HREF=r37_0566.html>plot_ymesh</A>, 
<A HREF=r37_0568.html>trplot</A>, 

<A HREF=r37_0563.html>plotkeep</A>, 
<A HREF=r37_0567.html>show_grid</A>. 
<P>
<P>


REDUCE Historical
REDUCE Sourceforge Project | Historical SVN Repository | GitHub Mirror | SourceHut Mirror | NotABug Mirror | Chisel Mirror | Chisel RSS ]