Part 4: Plotting
Go to Maple Portal Previous Tutorial Next Tutorial

Introduction


Maple's Tutorials are designed to help you get started with Maple, learn about the key tools available in Maple, and lead you through a series of problems.
In Part 4: Plotting, you will create 2D and 3D plots. You will learn how to combine multiple plots and create animations. You can create plots from a context menu, a command, or the Plot Builder Assistant.
To try this material on your own, start with an empty Maple document. Perform the steps described in the left column of each table below. The results of the steps are displayed in the right column for reference.
Refer to Help>Quick Reference for basic getting started tips.
Note for nonWindows users: The keystrokes given in this document are for Windows. There will be differences for other platforms. If you are using a different platform, see Help>Quick Help for the list of the most common keystrokes.


2D and 3D Plots


Maple can produce 2D and 3D plots of equations and expressions.
Steps

Result

2D Plots
Learn to plot in Maple. The fastest way to plot an expression in Maple is to use the context menu.
Example: Enter an expression in x (such as ), rightclick on the expression, and select Plots > 2D Plot.
Example: Use the point probe to find the coordinates of different points in the graph. Rightclick on the plot, then select Probe Info>Nearest point on line. When you hover over a point on the graph, the coordinates are displayed.
Example: To pan the plot, rightclick on the plot, and select Manipulator>Pan. Hold down the left mouse button and use the mouse to move the plot around. To scale the plot, perform the same steps, but select Manipulator>Scale.
Tip: You can also change the manipulator tool by clicking on the plot, and then selecting the appropriate tool from the plot toolbar:
Example: Enter an expression in x (such as ), rightclick on the expression, and select Plots > 2D Plot.
Observe that the default xrange for plots is 10 to 10 for most plots, but it is to for trigonometric plots.


Setting the Axis Properties for a Plot
The default range for a plot is chosen based on the values computed. You can set the range after creating a plot by modifying the axis properties.
Example: Click on the plot, then select the Axis Properties button
from the plotting toolbar. For both the horizontal and vertical axes, you can set min and max values, set number of tickmarks, and control advanced features such as number of subticks.
Example: Modify the vertical range for the plot of : Click on the plot, then select the Axis Properties button
from the plotting toolbar. Under the Vertical tab, clear the Use data extants check box, and change the Range min to 15.


Combining Plots
You can easily add another plot on the same set of axes.
Example: Enter another equation in (such as ), highlight the new expression with your mouse, and drag it onto the plot.
Tip: When you select and drag the expression onto the plot, the expression is deleted from its original position. Another way to drag is to use the Copy and Drag feature:
•

Highlight the expression, hold [Ctrl], and drag it onto the plot.

For this and other tips, see the Quick Reference Card (Help>Quick Reference).


Annotating Plots
You can add titles, captions, and legends to plots. (From the context menu, select Title or Legend.)
You can also add additional information to plots by using the drawing tools. Lines, arrows, text, 2D math, and shapes are available.
Example: Click on the plot, then click on the
button on the toolbar. Use the text tool (T) to enter labels for the curves. Use [F5] to toggle between text and math, and enter labels for the curves in Math mode.


Plotting with Commands
Example: Graph a polynomial using the plot command.
Note that when you don't specify a range, the default range [10, 10] is used.
Example: Graph the polynomial again, this time specifying the range [3, 5]. A range in Maple is given by a..b.
For more information and examples using the plot command, see plot.


To display multiple plot structures into a single graph using commands, use plots[display].
Example: Enter two plot commands.
Then use plots[display] to see both curves in a single graph.




Steps

Result

3D Plots
You can create 3D plots.
Example: Enter an expression in x and y (for instance, ). Rightclick on the expression and use Plots > 3D Plots > x,y from the context menu.
Example: Rotate the plot by clicking on the plot, holding down the left mouse button and moving the mouse.
Example: Pan and scale the plot by selecting a different tool from the Manipulator list on the context menu. Now when you hold down the mouse button and move the mouse, the new action is performed.
Tip: You can also change the manipulator tool by clicking on the plot, and then selecting the appropriate tool from the plotting toolbar:


Plot Options
You can modify the look of your plot in a variety of ways.
Plot options can be changed by rightclicking on the plot and modifying the options within the context menu. Note that the choices available in the context menu are specific to 3D plots.
Example: Rightclick on the plot to obtain the context menu. Click Color and choose XY to modify the shading.
Example: Click on the plot, and then from the context menu select Axes>Boxed.
Plot options can also be changed by clicking on the plot, selecting the Plot menu, and selecting the relevant options.


Plotting in 3D with Commands
Example: Graph a polynomial using the plot3d command.
For more information on the plot3d command, see plot3d.




Plotting Guide
In addition to plot and plot3d, many other plotting commands are available. The PlottingGuide makes it easy to find the plot type you need. Access the plotting guide from the Help menu under Manuals, Resources, and more>Plotting Guide


Using the Plot Builder Assistant


Steps

Result

Plots can easily be created in Maple using the builtin Plot Builder.
Example: Enter the expression you want to plot. From the context menu, select Plots>Plot Builder. Using the Plot Builder, you can choose the kind of plot you want, add titles, and set options, all at once. This example shows the use of plot title, normal axes and the style surface with contour.
The Plot Builder allows you to create more than just ordinary 2D and 3D plots. The example on the right is a contour plot.
Example: Enter the expression . Select Plots>Plot Builder from the context menu. Select 2D Contour Plot from the Select Plot Type list box, then click Plot.


You can also create an animation using the Plot Builder assistant.
Example: Enter the expression on the right, rightclick to invoke the context menu.
Select Plots>Plot Builder. Select Animation from the Select Plot Type dropdown list and click the Plot button.
Now click on the plot image. The animation toolbar is now available. Click the Play button
and watch the animation. To step through the frames of the animation, click
.


Using the Plot Builder to Return a Plot Command
Exercise: Find the derivative of and plot the result.
1.

To enter the expression: Use symbol completion to create the exponential Type "e [Esc]", and select e (exponential) from the list.

2.

To compute the derivative: From the context menu, choose Differentiate.

3.

To apply the Plot Builder: Select the output (the derivative) and choose the Plot Builder. Modify the view so the range is 0..10 and the range is 2000..2000. Preview the result. When you are done, click Command to return the plot command.

Tip: If you use the Plot Builder to create a plot and then return the plot command, you can easily modify and reuse this command. To use the command, simply copy the command to a new line and execute.




Exercise: Use the Plot Builder to create an interactive plot with 3 parameters for the expression .

Go to Maple Portal Previous Tutorial Next Tutorial
