densityplot sinxy x 11 y 11 1 y 05 1 05

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ou can save the plot for future use, as you would any other expression. Displaying an Assigned Plot To display the plot in the first example, use the display command defined in the plots package. 5.5 Composite Plots > with(plots): • 135 > display( my_plot ); 1 0.5 –10 –8 –6 –4 –2 0 –0.5 –1 2 4 x 6 8 10 The display command can draw a union of multiple plots. Simply give a list of plots. > a := plot( [ sin(t), exp(t)/20, t=-Pi..Pi ] ): > b := polarplot( [ sin(t), exp(t), t=-Pi..Pi ] ): > display( [a,b] ); 1 0.5 0 –0.5 –1 –1 –0.5 0.5 1 This technique allows you to display plots of different types in the same axes. You can also display three-dimensional plots and animations. > c := sphereplot( 1, theta=0..2*Pi, phi=0..Pi ): > d := cylinderplot( 0.5, theta=0..2*Pi, z=-2..2 ): > display( [c,d], scaling=constrained ); 136 • Chapter 5: Plotting Enter the previous definition of b and the following Maple commands to view an animation and a plot in the same axes. > e := animate( plot, [m*x, x=-1..1], m=-1..1 ): > display( [b,e] ); Displaying Animations Simultaneously If you display two or more animations together, ensure that they have the same number of frames. Enter the following example into Maple to view two animations simultaneously. > f := animate( plot3d, [sin(x+y+t), x=0..2*Pi, y=0..2*Pi], t=0..5, > frames=20 ): > g := animate( plot3d, [t, x=0..2*Pi, y=0..2*Pi], t=-1.5..1.5, > frames=20): > display( [f,g] ); Placing Text in Plots The title and labels options to the plotting commands allow you to put titles and labels on your graphs. The textplot and textplot3d commands allow you to specify the exact positions of the text. The plots package contains these two commands. > with(plots): You can use textplot and textplot3d as follows. textplot( [ x-coord, y-coord, "text " ] ); textplot3d( [ x-coord, y-coord, z-coord, "text "] ); For example, 5.6 Special Types of Plots > a := plot( sin(x), x=-Pi..Pi ): • 137 > > > > > b := textplot( [ Pi/2, 1.25, "Local Maximum" ] ): c := textplot( [ -Pi/2, -1.25, "Local Minimum" ] ): g := textplot( [ Pi/2, 1, "X" ] ): h := textplot( [ -Pi/2, -1, "X" ] ): display( [a,b,c,g,h] ); LocalMaximum X 1 0.5 –3 –2 –1 0 1 x 2 3 –0.5 –1 X LocalMinimum For details on controlling the placement of text, refer to the ?plots,textplot help page. To specify the font for textplot and textplot3d, use the font option. In the following plot, the origin, a saddle point, is labelled P . > d := plot3d( x^2-y^2, x=-1..1, y=-1..1 ): > e := textplot3d( [0, 0, 0, "P"], > font=[HELVETICA, OBLIQUE, 22], color=white ): > display( [d,e], orientation=[68,45] ); P 5.6 Special Types of Plots The plots package contains many routines for producing special types of graphics. This section provides example commands for plotting the following. 138 • Chapter 5: Plotting • Implicity defined functions •...
View Full Document

This note was uploaded on 08/27/2012 for the course MATH 1100 taught by Professor Nil during the Spring '12 term at National University of Singapore.

Ask a homework question - tutors are online