Classroom Tips and Techniques: Interactive Plotting: Vertical lines and Multiples of
Robert J. Lopez
Emeritus Professor of Mathematics and Maple Fellow Maplesoft
? Maplesoft, a division of Waterloo Maple Inc., 2007
Introduction
This month, we will discuss two interactive plotting strategies I had to consult the developers to master. It's likely that many of our readers will already have discovered the same devices themselves, but I'm also sure that there are others like me who will have struggled to find these functionalities on their own.
The Plot Builder is Maple's most robust interactive plotting tool. It provides access to the type of plot to be drawn, and to the properties of the plot. The other interactive plotting tools available in the Plots option of the Context Menu lack this flexibility. Consequently, we discuss how, with the Plot Builder, to plot a vertical line, and how to label an axis with multiples of
Initializations
Plotting the Graph of a Vertical Line
In the -plane, the graph of the solution set of the equation is a vertical line. This line cannot be obtained as the graph of a function, so Maple's plot command will not graph the vertical line without user intervention. Figure 1 shows a portion of this line drawn with the plot command as a line segment. Figure 2 draws this same line segment as the parametric curve .
Figure 1 Graph of the vertical line segment by specifying its endpoints
Figure 2 Parametric plot of the vertical line segment
Clearly, graphing a vertical line segment via the plot command requires significant user intervention and knowledge of Maple syntax. Figure 3 provides a graph of the vertical line segment drawn as an implicit plot with the implicitplot command from the plots package.
Figure 3 Graph of the vertical line drawn as an implicit plot
Figures 1 - 3 all require some mathematical insight on the part of the user, who must correspondingly implement some appropriate Maple construct that reflects that view of the vertical line. Now what happens when the user naively tries to plot interactively via the Context Menu? Right-click on the equation and the Context Menu will contain Plots/2-D Implicit Plot, and the two choices and . Assuming that the first choice means the horizontal axis is the -axis, the resulting graph will be that of the horizontal line This is clearly incorrect, an error that will be corrected in the next release of Maple. Note that this graph by-passes the Plot Builder where there might have been a chance to select as plot type, an implicit plot.
To involve the Plot Builder, launch it from the Tools/Assistants menu. In the Expressions section, click the Add button, and in the ensuing dialog box, enter . See Figure 4.
Figure 4 Launch the Plot Builder from the Tools/Assistants menu; under Expressions, select Add, enter the equation and press the Accept button
Pressing the Accept button will enter the equation into the Expression box, and add the variable to the Variables box. In the Variables section, click the Add button and add the variable . See Figure 5.
Figure 5 Add the variable to the Variables box
When the Accept button is pressed, the variable will be added to the Variables box. Pressing the OK button will lead to the dialog box shown in Figure 6.
Figure 6 The Plot Builder now provides access to the 2-D implicit plot, from which the graph of the vertical line follows
Alternatively, right-clicking on the expression provides access to the Plot Builder through Plots in the Context Menu. In this case, the Edit Functions button (see Figure 7) will lead to the Add Variables option shown in Figure 5.
Figure 7 Use the Edit Functions button to access the Add Variables option as shown in Figure 5
Labeling an Axis in Multiples of
The Plot Builder can be used for the interactive drawing of a graph whose -axis, for example, can be labeled in multiples of . Use the context menu to launch the Plot Builder for graphing, say, . As per Figure 8, press the Options button to access the dialog for plot options, then select the Advanced Settings option in the Axes section on the lower left. In the Advanced Axis Settings dialog box, open the drop-down listing under Tickmarks for the -axis. At the very end of the list, select "spacing(2, 0)."
Figure 8 On the left, click "Advanced Settings" in the Axes box; on the right, in the -row of the Axis box, click the down arrow in the Tickmarks column and select "spacing(2, 0)," the last item in the drop-down listing.
After selecting "spacing(2,0)," edit the "2" to the desired multiple of that should be used on the graph. For example, change the "2" to Pi/2. (Remember, in Maple's pop-up dialogs, all entries are in text mode.) Press the Apply button and proceed with the usual plotting steps in the Plot Builder. Figure 9 shows the typical outcome.
Figure 9 Plotting in multiples of via the Plot Builder
Note that instead of obtaining rational multiples of , Maple has floated the rational coefficients of . This is the best that can be achieved with the Plot Builder. To obtain a graph labeled with rational multiples of , the plot command must be used. Figure 10 shows that the "simplest" usage of the plot command also produces a graph with floating-point coefficients of .
Figure 10 Naive use of the plot command produces floating-point coefficients of on the horizontal axis
The more complex syntax used to produce Figure 11 results in rational coefficients of along the horizontal axis.
Figure 11 Use of the plot command to label an axis with rational coefficients of
The plot command in Figure 11 requires that the location and notation for the axis labels be explicitly provided. The syntax appearing in the tickmarks option generates the sequence of equations
The left side of one such equation gives the location of the axis label, while the right side gives the notation that is to appear at that location. This becomes transparent in Figure 12 where the horizontal axis is labeled in multiples of the symbol "A".
Figure 12 Labeling the horizontal axis in multiples of the symbol "A"
Legal Notice: The copyright for this application is owned by Maplesoft. The application is intended to demonstrate the use of Maple to solve a particular problem. It has been made available for product evaluation purposes only and may not be used in any other context without the express permission of Maplesoft.