Appendix
A-9: Graphing
Example A-9.1
Obtain the graph in Figure A-9.1(a), a graph of sinx as a black curve, and cosx as a red curve.
Impose 1-to-1 scaling on the axes, and ensure that the axes are labeled as x and y.
Label the horizontal axis in multiples of π/4 and the vertical axis with just three values (−1,0,1).
Figure A-9.1(a) Graph of sinx (black) and cosx (red)
Solution
Maple Solution - Interactive
Solution via Plot Builder
Write a sequence of the two given functions.
Context Panel: Plot Builder≻Edit (either button) Basic Options: Set x-range Global Options: View: axis[1] set x-range 2-D Options: Scaling = constrained
sinx,cosx→
Alternatively, launch the Plot Builder with sinx and cosx embedded by clicking . (The Preview and Options buttons will work, but no graph will be embedded in this worksheet.)
Figure A-9.1(b) Initial pane for the Interactive Plot Builder
Figure A-9.1(c) Edited range in the Plot Builder
Select 2-D trigonometric plot.
The default interval for trig functions is −2 π,2 π, which is easily edited to 0,π. See Figures A-9.1(b-c).
Click the Options button to access the plot options. To make changes that affect both curves, select "Global Defaults & Settings" in the drop-down box at the top-left of the Options panel. Add the Label "y" in the Range from/to line. Check the box for Constrained Scaling. See Figure A-9.1(d).
The horizontal axis is automatically labeled in multiples of π for trig functions. This can be adjusted as follows.
In the Axes section, select Advanced Settings and in the Advanced Axis Settings dialog, use the Tickmarks drop-down for x to select "spacing(Pi,0)" in which Pi can be changed to Pi/4. Change the Tickmarks from "default" to 3 for the other axis, and click the Apply button. See Figure A-9.1(e).
Figure A-9.1(d) Options panel after changes made
Figure A-9.1(e) Advanced Axis Settings panel
Clicking the Close button returns focus to the Options pane.
Change "Global Defaults & Settings" to an individual function to change the color of its graph.
Click the Preview button to see the state of the graph at any time.
Maple Solution - Coded
The following version of the plot command will draw the graph in Figure A-9.1(a).
plotsinx,cosx,x=0..π,color=black,red,scaling=constrained,tickmarks=spacing⁡π/4,0,3,labels=x,y
<< Previous Section of Appendix Section A-9 Next Example >>
© Maplesoft, a division of Waterloo Maple Inc., 2024. All rights reserved. This product is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation.
For more information on Maplesoft products and services, visit www.maplesoft.com
Download Help Document