# # 6.1 2-dimensional plotting # # # # MAPLE SESSION 1 # > plot(sin(x),x=-2*Pi..2*Pi); # # 6.1.1 Restricting domain and range # # # # MAPLE SESSION 2 # > plot(sec(x),x=-Pi..2*Pi,y=-5..5); # # # MAPLE SESSION 3 # > plot(sec(x),x=-Pi..2*Pi,y=-5..5,discont=true); # # 6.1.2 Parametric plots # # # # MAPLE SESSION 4 # > plot([cos(t),1/2*sin(t),t=0..2*Pi]); # # 6.1.3 Multiple plots # # # # MAPLE SESSION 5 # > plot([sqrt(x),3*log(x)],x=0..400); # # # MAPLE SESSION 6 # > plot([sqrt(x),3*log(x)],x=0..400,numpoints=1000); # # # MAPLE SESSION 7 # > with(plots): > p1:=plot(sqrt(x),x=0..400): > p2:=plot(3*log(x),x=0..400): > display(p1,p2); # # # MAPLE SESSION 8 # > with(plots); # # 6.1.4 Polar plots # # # # MAPLE SESSION 9 # > with(plots): > polarplot(cos(5*t),t=0..2*Pi); # # # MAPLE SESSION 10 # > polarplot({cos(5*t),t},t=0..2*Pi); # # # MAPLE SESSION 11 # > plot([cos(t)*cos(5*t),sin(t)*sin(5*t),t=0..2*Pi]); # # 6.1.5 Plotting implicit functions # # # # MAPLE SESSION 12 # > with(plots): > implicitplot(x^2+4*y^2=1,x=-1..1,y=-1/2..1/2); # # 6.1.6 Plotting points # # # # MAPLE SESSION 13 # > L := [[0,0],[1,1],[2,3],[3,2],[4,-2]]: > plot(L); # # # MAPLE SESSION 14 # > plot(L, style=point); # # 6.1.7 Title and text in a plot # # # # MAPLE SESSION 15 # > p1:=plot([sqrt(x),3*log(x)],x=0..400, > title=`The Square Root and log functions`): > display(p1); # # # MAPLE SESSION 16 # > p2:=textplot([[360,16,`y=3log(x)`], > [130,10,`y=sqrt(x)`]]): > display(p1,p2); # # # MAPLE SESSION 17 # > plot([sqrt(x),3*log(x)],x=0..400, > title="The Square Root \n and log functions", > legend=["y=sqrt(x)","y=3log x"]); # # # MAPLE SESSION 18 # > with(plots): > textplot([1,1,`m`], font=[SYMBOL,12]); # # # MAPLE SESSION 19 # > with(stats): > with(plots): > xaxis:=plot([[-5,0],[7,0]]): > meanl1:=plot([[0,0],[0,0.42]],linestyle=2): > meanl2:=plot([[1,0],[1,0.42]],linestyle=2): > p1:=plot(statevalf[pdf,normald[0,1]](t),t=-5..5): > p2:=plot(statevalf[pdf,normald[1,1]](t),t=-4..5): > t1:=textplot([0,-0.02,m],font=[SYMBOL,12], > 'align=BELOW'): > t2:=textplot([1,-0.02,"m*"],font=[SYMBOL,12], > 'align=BELOW'): > display(xaxis,p1,p2,t1,t2,meanl1,meanl2, > view=[-5..7,-0.02..0.42], axes=none); # # # MAPLE SESSION 20 # > textplot([1,1,`@`],font=[SYMBOL,12]); # # # MAPLE SESSION 21 # > with(plots): > textplot([0,0,convert([192], bytes)], font=[SYMBOL,12], > axes=none); # # # MAPLE SESSION 22 # > with(plots): > > chardisplay:=n -> display(textplot([0,0,convert([n],bytes)], > font=[SYMBOL,12]),axes=none): # # # MAPLE SESSION 23 # > chardisplay(169); # # 6.1.8 Plotting options # 6.1.9 Saving and printing a plot # # # # MAPLE SESSION 24 # > plotsetup(ps, plotoutput=`plot.ps`, > plotoptions=`portrait, noborder`); > plot(sin(x),x=-2*Pi..2*Pi); > interface(plotdevice=inline); # # # MAPLE SESSION 25 # > plotsetup(hpgl, plotoutput=`plot.hp`, > plotoptions=`laserjet`); # # 6.1.10 Other plot functions # # # # MAPLE SESSION 26 # > with(plots): # # # MAPLE SESSION 27 # > complexplot(exp(I*x),x=0..2*Pi); # # # MAPLE SESSION 28 # > conformal(sin(z),z=-1-I..1+I); # # # MAPLE SESSION 29 # > coordplot(polar,[0..2,0..2*Pi],labelling=true, > grid=[5,13], view=[-2..2,-2..2],scaling=constrained); # # # MAPLE SESSION 30 # > fieldplot([-y,x],x=-1..1,y=-1..1); # # # MAPLE SESSION 31 # > inequal( x-y<=0,x+y<=1,5+2*x>=y, x=-6..3,y=-6..6, > optionsfeasible=(color=red),optionsexcluded=(color=yellow)); # # # MAPLE SESSION 32 # > inequal( x-y<0,x+y<1,5+2*x>y, x=-6..3,y=-6..6, > optionsfeasible=(color=red),optionsexcluded=(color=blue)); # # # MAPLE SESSION 33 # > logplot(tan(x),x=0..1.55); # # # MAPLE SESSION 34 # > L := [[0,1],[1,1],[1/2,1/2]]: > polygonplot(L); # # # MAPLE SESSION 35 # > > ngon := n -> [seq([ cos(2*Pi*i/n), sin(2*Pi*i/n) ], > i = 1..n)]: > polygonplot(ngon(5),scaling=constrained,axes=none, > title="Regular Pentagon",color=yellow); # # # MAPLE SESSION 36 # > npt :=(r,i,n) -> [r*cos(2*Pi*i/n),r*sin(2*Pi*i/n)]; > shard:=(i,n,col)->polygonplot([npt(1,i,n),npt(2,(2*i+1), > 2*n),npt(1,i+1,n)],color=col): > nstar:=(n,col)->display(seq(shard(i,n,col),i=1..n), > scaling=constrained, axes=none): > nstar(17,blue); # # # MAPLE SESSION 37 # > semilogplot({sqrt(x),log(x)},x=0.1..100); # # # MAPLE SESSION 38 # > setoptions(title=`Semilog plot of Sqrt and Log`, > axes=BOXED); > semilogplot({sqrt(x),log(x)},x=0.1..100); # # # MAPLE SESSION 39 # > setoptions(title=``, axes=normal); # # 6.2 3-dimensional plotting # # # # MAPLE SESSION 40 # > plot3d(exp(-(x^2 + y^2-1)^2), x=-2..2, > y=-2..2); # # # MAPLE SESSION 41 # > plot3d(exp(-(x^2 + y^2)^2), > x=-2..2,y=-2..2, > grid=[50,50]); # # # MAPLE SESSION 42 # > plot3d(3 - x - 3*y/2,x=0..3,y=0..2,axes=normal, > orientation=[20,60], view=[0..4,0..3,0..4]); # # 6.2.1 Parametric plots # # # # MAPLE SESSION 43 # > plot3d([sqrt(1+u^2)*cos(t),sqrt(1+u^2)*sin(t),u], > u=-1..1, t=0..2*Pi); # # 6.2.2 Multiple plots # # # # MAPLE SESSION 44 # > plot3d({exp(-x^2-y^2),x+y+1},x=-2..2, y=-1..1); # # # MAPLE SESSION 45 # > with(plots): > p1:=plot3d(exp(-x^2-y^2),x=-2..2, y=-1..1): > p2:=plot3d(x+y+1,x=-2..2,y=-1..1): > display(p1,p2); # # 6.2.3 Space curves # # # # MAPLE SESSION 46 # > with(plots): > spacecurve([cos(t),sin(t),t],t=0..4*Pi, numpoints=200, > orientation=[22,60],axes=BOXED); # # 6.2.4 Contour plots # # # # MAPLE SESSION 47 # > contourplot(exp(-(x^2+y^2-1)^2), > x=-(1.3)..(1.3), > y=-(1.3)..(1.3), filled=true, coloring=[blue,red]); # # # MAPLE SESSION 48 # > contourplot3d(exp(-(x^2+y^2-1)^2), > x=-(1.3)..(1.3), > y=-(1.3)..(1.3), filled=true, coloring=[blue,red]); # # 6.2.5 Plotting surfaces defined implicitly # # # # MAPLE SESSION 49 # > with(plots): > implicitplot3d(y^2 - x^2 = z, x=-2..2, > y=-2..2, > z=-4..4); # # # MAPLE SESSION 50 # > implicitplot3d(x^2 + y^2 - z^2 = 1, > x=-1..1, y=-1..1, > z=-1..1); > implicitplot3d(x^2 + y^2 - z^2 = 1, > x=-2..2, y=-2..2, > z=-1..1); # # 6.2.6 Title and text in a plot # # # # MAPLE SESSION 51 # > with(plots): > p1:=plot3d(exp(-(x^2+y^2-1)^2), > x=-2..2,y=-2..2, > font=[TIMES,ROMAN,12],titlefont=[HELVETICA,BOLD,10], > title=`The surface z=exp(-(x^2+y^2-1)^2)`): > p2:=textplot3d([0,1.1,1,`Circular Rim`], align=RIGHT, > color=BLUE): > display(p1,p2); # # 6.2.7 $3$-dimensional plotting options # 6.2.8 Other $3$-dimensional plot functions # # # # MAPLE SESSION 52 # > with(plots): # # # MAPLE SESSION 53 # > fieldplot3d([x/sqrt(x^2+y^2+z^2),y/sqrt(x^2+y^2+z^2), > z/sqrt(x^2+y^2+z^2)],x=-1..1,y=-1..1,z=-1..1); # # # MAPLE SESSION 54 # > with(plots): > polyhedraplot([0,0,0],polytype=dodecahedron, > style=wireframe,scaling=CONSTRAINED,orientation=[71,66]); # # # MAPLE SESSION 55 # > polyhedraplot([0,0,0],polytype=icosahedron, > style=patch,scaling=CONSTRAINED); # # # MAPLE SESSION 56 # > with(plots): > spacecurve([cos(t),sin(t),t],t=0..4*Pi, numpoints=200, > orientation=[22,60],axes=BOXED); # # 6.3 Animation # # # # MAPLE SESSION 57 # > with(plots): > animate(1/(1+x*t),x=0..10,t=0..1, frames=10); # # # MAPLE SESSION 58 # > > animate([Pi/2*sin(t*(u+1)),sin(2*t)*sin(Pi/2*sin(t*u+t)), > t=-2*Pi..2*Pi], u=0..1,frames=20,numpoints=200, > color=blue); # # # MAPLE SESSION 59 # > with(plots): > > animate3d([r*cos(t+a),r*sin(t+a),r^2*cos(2*t)], r=0..1, > t=0..2*Pi, a=0..3, frames=10,style=patch, > title=`The Rotating Saddle`); # # # MAPLE SESSION 60 # > animate3d([r*cos(t+a),r*sin(t+a),r^2*cos(2*t)+sin(a)], > r=0..1,t=0..2*Pi, a=0..2*Pi,frames=10,style=patch, > title=`The Flying Pizza`);