How Do I - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Getting Started : How Do I... : HowDoI/PlotMultipleFunctions

How Do I

  

Plot Multiple Functions?

 

 

Using Commands

Drag and Drop

Related Topics

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

 

 

 

 

 

Press Enter to display the plot.

Example: Plotting x,x2 with Custom Color

Step

Description

Illustration

1

Type the following:

 

plot([x,x^2,x=0..2,color=blue,red])

 

plotx,x2,x=0..2,color=blue,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=blue):

 

Then, press Enter.

 

plot2plotcos,color=blue:

 

 

 

 

 

 

 

3

Type the following:

 

plots:-display([plot(sin), plot(cos, color=blue)])

 

Then, press Enter.

plots:-displayplotsin,plotcos,color=blue

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

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.

 

Right-click sin(x) and 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

The How Do I... topics cover the essentials for doing mathematics in Maple.  Learn more about available tools and features, such as palettes and context-sensitive menus.

How Do I...

...Enter a Complex Number?

...Enter a Function?

...Enter a Matrix?

...Enter a Simple Expression?

...Evaluate an Expression?

...Plot a Function?

...Plot a Straight Line?

...Select a Math Style?

...Work with Random Generators?

 

Tools and Features

Palettes

Context-Sensitive Menus

Command Completion

Equation Labels

Assistants

Maple Help

Plotting Guide

Applications

Example Worksheets

Manuals

Refer to Help>Quick Reference for basic Getting Started tips.

See Also

plot

Plotting Tutorial

Plotting Guide

Plot Builder