{VERSION 3 0 "DEC ALPHA UNIX" "3.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "commands" -1 256 "Times" 1 12 0 128 0 1 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 257 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "" 0 "" {TEXT -1 331 "To visualize 2-dimensional data in the form of a functio n f(x,y) Maple gives you two choices: (1) plot the function values as \+ the height of a surface above the xy plane or (2) draw contours of con stant f(x,y) in the xy plane. Which does a better job depends on the \+ problem and on your tastes. Here is an example done both ways. " }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "3d plot" {TEXT -1 22 "Co nsider the function " }{XPPEDIT 18 0 "f(x,y) = exp(-abs(x-sin(y)))*(1+ .2*cos(x/2))*(1+.4/(.3+y^2));" "6#/-%\"fG6$%\"xG%\"yG*(-%$expG6#,$-%$a bsG6#,&F'\"\"\"-%$sinG6#F(!\"\"F6F2,&\"\"\"F2*&$\"\"#!\"\"F2-%$cosG6#* &F'F2\"\"#F6F2F2F2,&\"\"\"F2*&$\"\"%!\"\"F2,&$\"\"$!\"\"F2*$F(\"\"#F2F 6F2F2" }{TEXT -1 81 " , the \"mountain range\" function. A three-dime nsional surface plot is done with " }{TEXT 256 6 "plot3d" }{TEXT -1 10 " like this" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 78 "plot3d(ex p(-abs(x-sin(y)))*(1+.2*cos(x/2))*(1 + .4/(.3+y^2)),x=-6..6,y=-6..6); " }}}{PARA 0 "" 0 "" {TEXT -1 217 "This looks rather interesting, but \+ the detail is too crude to really see what is going on, and we might w ant to use a different viewing angle too. These things are controlled with options which you can read about in " }{TEXT 256 16 "?plot3d[opt ions]" }}{PARA 0 "" 0 "" {TEXT -1 1 " " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 152 "plot3d((1+.2*cos(x/2))*exp(-abs(x-sin(y)))*(1+.4/(.3 +y^2)),x=-6..6,y=-6..6,grid=[60,60],labels=[\"x\",\"y\",\"f\"],orienta tion=[45,30],axes=boxed,shading=xy);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 53 "As you can see the s urface grid is controlled by the " }{TEXT 256 10 "grid=[m,n]" }{TEXT -1 54 " option, the labels on the axes are controlled by the " }{TEXT 256 6 "labels" }{TEXT -1 135 " option, and the viewing angle is contro lled by orientation. A word of warning: the mathematicians who wrote \+ Maple are used to having " }{XPPEDIT 18 0 "phi;" "6#%$phiG" }{TEXT -1 75 " be the angle in spherical coordinates that comes down from the z- axis and " }{XPPEDIT 18 0 "theta;" "6#%&thetaG" }{TEXT -1 71 " be the \+ azimuthal angle that winds around the z-axis in the xy plane. " } {TEXT 257 59 "This is exactly backwards from the way we do it in physi cs." }{TEXT -1 113 " So to be consistent with the way we do spherical coordinates in physics, the form of the orientation option is " } {TEXT 256 13 "orientation=[" }{XPPEDIT 18 0 "phi,theta;" "6$%$phiG%&th etaG" }{TEXT -1 0 "" }{TEXT 256 2 "] " }{TEXT -1 91 "which is exactly \+ backwards from what you will read in online help. In addition, the an gle " }{XPPEDIT 18 0 "phi;" "6#%$phiG" }{TEXT -1 281 " indicates the d irection along which the viewer is sighting rather that the angular po sition of the viewer. This is weird enough that you will just have to experiment until you get what you want. Finally, the appearance of t he plot is altered by the shading command which can be " }{TEXT 256 35 "shading=z, shading=xy, shading=xyz," }{TEXT -1 35 " or a few other things found under " }{TEXT 256 7 "?plot3d" }{TEXT -1 38 ". Experime nt and see what looks best." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "contour plot" {TEXT -1 131 "You can look at the same mountain \+ with a contour, or topographic map, view like this (note that to use t his command you have to to " }{TEXT 256 11 "with(plots)" }{TEXT -1 8 " first) " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "with(plots):" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 130 "contourplot((1+.2*cos(x/2) )*exp(-abs(x-sin(y)))*(1 + .4/(.3+y^2)),x=-6..6,y=-6..6,contours=20,gr id=[30,30],coloring=[green,blue]);" }}}{PARA 0 "" 0 "" {TEXT -1 241 "N ote that the coloring=[green,blue] plots the low values of the functio n in green, the high values in blue, and in-between values in colors b etween green and blue. You can use any two Maple colors you want in t his option (see ?plot[colors])" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "?plot[colors]" }}}}{MARK "13" 0 }{VIEWOPTS 1 1 0 1 1 1803 }