Maple Tutor
Part
7: Graphing
Functions
- Let's
plot 3 sin(2x) over the interval [0,2π].
First we need to make sure x
is unassigned. Enter
x
to check. If Maple
says that x has
an assigned value, then remove it. Now type
3*sin( 2*x )
Use your mouse to
highlight this expression, click the right
mouse button, and select "Plots" > "Plot Builder" from
the popup menus. Make sure the first text box says "Plot" and
the second box says "2-D plot". Down below that it should say
"x Axis", then "x" and then two boxes with numbers in them.
In the first box enter "0" and in the second box enter
"2*Pi". (If you leave out the asterisk or forget to
capitalize the P it will not work.) When you click the "Plot" button Maple should make
an arrow pointing from your formula to its plot. (Note that Maple may switch to Text mode without warning after the plot.)
We can
obtain the same result by defining the function f given
by
f(x) = 3 sin(2x)
and plotting f(x). Enter
the following:
f := x -> 3*sin(2*x)
and
f( x )
Use the
popup menus to plot this function over the interval [0,2π].
- When
the plot appears, use your mouse to "select" it -- you should see a box
around the graphic. Experiment with the drag buttons at the corners and
sides of the box. Experiment with the icons at the top of the screen to
see what they do. In particular, obtain each of the following:
- A plot with no axes
- A plot with dots
instead of a solid curve
- A boxed plot
- A plot with the
appropriate aspect ratio, i.e., the horizontal units are the same as
the vertical units.
- A
"zoomed-in" version of the plot.
- A
"zoomed-out" version of the plot.
- A
view of just the left-hand part of the plot.
- A
view of just the bottom part of the plot.
- You
can also use your
right-hand mouse button to change the plot. Experiment with
the
popup menus to see what they do. In particular, obtain
each of the following:
- A plot with a dashed
line instead of a solid curve.
- A plot with a green
curve instead of a red one.
- Next
we plot data given as ordered pairs. To do this we need the pointplot command
in the Plots
package. First we need to load the plots package.
From the menu bar at the very top of the Maple window select
"Tools" > "Load Package" > "Plots". Maple should give
you the message
Loading plots
(You may click on the underlined link if you want to see a list of
commands in the Plots
package.)
Enter
data:=[[0,1],[2,2],[4,6],[5,1]]
Then enter
pointplot(data)
to see the plot.
- Often
we wish to view several graphs at the same time. One way to do this is
directly with the popup menus. Type
sin(x), cos(x)
Use your mouse to
highlight this expression, click the right
mouse button, and select "Plots" > "Plot Builder" from
the popup menus. Make sure the first text box says "Plot" and
the second box says "2-D plot". Set the x
axis and click "Plot" as before.
- Another
way to create multiple plots is to construct the plots
separately and copy-and-paste them onto the same axes. Enter
sin(x)
and
use the popup menus to plot it over the interval [0,2π].
Do the same for
cos(x)
but change it to a different color. Then use
your mouse to copy and paste the cosine curve onto the sine curve.