It is very easy to plot multiple curves or objects in the same picture. For a collection of functions, simply give the functions as a list or a set, all using the same independent variable.
> plot( { cos(x),-cos(x),0.5*(sin(19*x)+sin(21*x)) },
> x=0..2*Pi,numpoints=1000,scaling=CONSTRAINED);
Notice that Maple automatically colors the three curves differently.
This can be changed by the color option. The
numpoints option specifies that a much larger number of
points should be plotted, in order to achieve a smoother looking
curve.
The plots package, which is loaded by the command:
> with(plots);
The most important of these is the display command. We can define various plot commands and assign them to variable names.
> p1:=plot( {cos(x),-cos(x)}, x=0..2*Pi,color=blue,linestyle=3):
> p2:=plot( .5*(sin(19*x)+sin(21*x)),
> x=0..2*Pi,color=red,numpoints=1000 ):
The outer cosine curves are dashed (linestyle option),
colored blue, and stored in p1. Note that this line ends with
a colon : . That prevents the output of the actual commands
that constitute the plot, which are quite voluminous. The
superposition of the high frequency sine curves is colored red. The
plot is actually made by the following command.
> display({p1,p2}, axes=boxed,view=[0..2*Pi,-2..2],scaling=CONSTRAINED);
The display command puts together any list or set of plots
with prescribed options.