Part 4: Plotting
Go to Maple Portal Previous Tutorial Next Tutorial
2-D and 3-D Plots
Using the Plot Builder Assistant
Maple 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 2-D and 3-D plots. You will learn how to combine multiple plots and create animations. You can create plots from the Context Panel, 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 non-Windows 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 Shortcut Keys.
Maple can produce 2-D and 3-D plots of equations and expressions.
Learn to plot in Maple. The fastest way to plot an expression in Maple is to use the Context Panel.
Example: Enter an expression in x (such as 6⋅ x−x2), and then select Plots > 2-D Plot from the Context Panel.
Example: Use the point probe to find the coordinates of different points in the graph. From the Context Panel for the plot, 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, click on the plot, and select Manipulator>Pan from the Plot menu or Context Panel. 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 sin2x), and from the Context Panel for the expression, select Plots > 2-D Plot.
Setting the Axis Properties for a Plot
The default x-range is chosen to be a reasonable domain for the given expression.
The default y-range for a plot is chosen based on the values computed. You can change 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 6⋅ x−x2: Click on the plot, then select the Axis Properties button
from the plotting toolbar. Under the Vertical tab, clear the Use data extents check box, and change the Range min to -15.
You can easily add another plot on the same set of axes.
Example: Enter another equation in x (such as sinx2), 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).
You can add titles, captions, and legends to plots. (From the Context Panel, select Title or Legend.)
You can also add additional information to plots by using the drawing tools. Lines, arrows, text, 2-D math, and shapes are available.
Example: Click on the plot, then from the
drop-down menu in the context bar, and select
. 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.
You can specify the range for the plot.
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.
For more information and examples, see the plots:-display help page.
You can create 3-D plots.
Example: Enter an expression in x and y (for instance, sinx⋅y ). From the Context Panel for the expression use Plots > 3-D Plots > x,y.
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 in the Context Panel. 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:
You can modify the look of your plot in a variety of ways.
Plot options can be changed by clicking on the plot and modifying the options in the Context Panel. Note that the choices available in the Context Panel are specific to 3-D plots.
Example: Click on the plot to obtain the context-sensitive options. Click Color and choose XY to modify the shading.
Example: Click on the plot, and then in the Context Panel select Axes>Framed.
Plot options can also be changed by clicking on the plot, selecting the Plot menu, and selecting the relevant options.
Plotting in 3-D with Commands
Example: Graph a polynomial using the plot3d command.
For more information on the plot3d command, see plot3d.
In addition to plot and plot3d, many other plotting commands are available. The PlottingGuide makes it easy to find the plot type you need. You can also access the plotting guide from the Maple Help System. In the Table of Contents, navigate to Graphics > Plotting Guide.
Plots can easily be created in Maple using the built-in Plot Builder.
Example: Enter the expression you want to plot. In the Context Panel, 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 uses the default options and adds a caption that uses 2-D math.
For plot type, the initial type selected for this expression in 2 variables is 3-D plot.
Select Axes and Text, and enter the caption z=x2−y2.
The Plot Builder allows you to create more than just ordinary 2-D and 3-D plots. The example on the right is a contour plot.
Example: Enter the expression x2+y2. Select Plots>Plot Builder in the Context Panel. From the drop-down list in the panel select 2-D contour plot for the plot type.
Using the Plot Builder to Return a Plot Command
Exercise: Find the derivative of ⅇ tt⁢and plot the result.
To enter the expression: Use symbol completion to create the exponential ⅇ. In Math mode, type e. press Esc, and select e (exponential) from the list.
To compute the derivative: In the Context Panel, choose Differentiate>with respect to t.
To apply the Plot Builder: Select the output (the derivative) and in the Context Panel, select Plot Builder.
Click the toggle button for Show Command.
Modify the view. Under Basic Options, set the t range to 0..10. Under Global Options, set the range for axis to -2000..2000.
The worksheet shows the plot and below it, the command for this plot.
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.
ⅇtt→differentiate w.r.t. tⅇtt−ⅇtt2→
Exercise: Use the Plot Builder to create an interactive plot with 3 parameters for the expression sina⋅x+b+c.
Animation Toolbar, Overview of Plotting, plot, plot3d, plots[display]. Plot Builder, Plot Toolbar, Plotting Guide
Download Help Document