Close
Close window
Plot multiple functions - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


Home : Support : Online Help : Getting Started : How Do I... : Plot multiple functions
[フレーム] [フレーム]

How Do I

Plot Multiple Functions?

Using Commands

Plotting Lists of Expressions

The following examples with the plot command provide a list of expressions to plot.

Note: In Maple, a list is denoted using [ ] square brackets.

Example: Plotting Sine and Cosine on Same Plot

Step

Description

Illustration

1

Type the following:

plot([sin, cos])

plotsin,cos

2

Example: Plotting x,x2 with Custom Color

Step

Description

Illustration

1

Type the following:

plot([x,x^2],x=0..2,color=["DarkViolet","Red"])

plotx,x2,x=0..2,color=DarkViolet,Red

2

Press Enter.

Example: Plotting a Sequence

Step

Description

Illustration

1

Type the following:

plot([seq(BesselJ(n,x),n=1..4)],x=0..2*Pi,filled)

plotseqBesselJn,x,n=1..4,x=0..2Pi,filled

2

Press Enter.

Example: Plotting Multiple 3-D Plots

This also works for 3-D plots:

Step

Description

Illustration

1

Type the following:

plot3d([x,sin(x)*y], x=-2*Pi..2*Pi, y=-5..5)

plot3dx, sinxy,x=2Pi..2Pi,y=5..5

2

Press Enter.

Plotting Multiple Plot Structures

You can also combine multiple plot structures and display these together using the plots:-display command:

Example: Plotting Multiple Plot Structures Together

Step

Description

Illustration

1

Type the following: plot1:= plot(sin):

Then, press Enter.

plot1plotsin:

2

Type the following:

plot2 := plot(cos, color="Niagara Green"):

Then, press Enter.

plot2plotcos,color=Niagara Green:

3

Type the following:

plots:-display([plot1,plot2])

Then, press Enter.

Example: Plotting Multiple 3-D Plots

The plots:-display command also works on 3-D plots:

plot3plot3dsinxy,x=2Pi..2Pi,y=5..5:

plot4plot3dy,x=2Pi..2Pi,y=5..5:

plots:-displayplot3,plot4

Using Plot Builder

You can use the Plot Builder from the Context Panel to plot a list or sequence of expressions.

Here is the first from the previous section.

Example: Using Plot Builder to Plot Two Expressions

Step

Description

Illustration

1

Type the following, and from the Context Panel, select Plot Builder:

sin(x),cos(x)

sinx,cosx

2

The plot is shown in the main window, and in the Plot Builder window you can change options.

If you select Show Command in the right panel, you can see the underlying command used to create this plot. (It's plots:-display.)

Drag and Drop

You can also combine multiple plots using drag and drop.

Example: Combining the Plots for sinx and sinx2

Step

Description

Illustration

1

Type the following: sin(x)

Press Enter.

Click sin(x) and, from the context panel, choose Plots >2-D Plot.

sinx

2

Type the following: sin(x/2)

sin x2:

3

Drag the expression sinx2 onto the existing plot of sinx.

Related Topics


Download Help Document

AltStyle によって変換されたページ (->オリジナル) /