maple_for_pictures.mws

Maple for making pictures

Copyright 2000-2005, SUNY Buffalo.

Plotting curves:
Graphs:

> plot(sin(x),x=0..10);

[Plot]

Sepcifying a vertical range:

> plot(exp(x),x=0..10,0..10,labels=[foo,bar]);

[Plot]

Plotting several graphs together:

> plot([sin(x),cos(x),cosh(x),sinh(x)],x=-2..2,color=[red,green,blue,black]);

[Plot]

Parametric plane curves:

> plot([cos(t),sin(t),t=0..3/2*Pi],
 scaling=constrained,axes=boxed,color=blue,thickness=3);

[Plot]

Combining plots:

> p1:=plot([cos(t),sin(t),t=0..3/2*Pi],
 scaling=constrained,axes=boxed,color=blue,thickness=3):

p2:=plot([cos(t),sin(t)/2,t=0..3/2*Pi],

 scaling=constrained,axes=boxed,color=red, thickness=3):

plots[display](p1,p2);

[Plot]

Implicit plane curves:

> with(plots):
eqn:=sin(x*y)+x^2=1;

implicitplot(eqn,x=-2..2,y=-2..2);

eqn := sin(x*y)+x^2 = 1

[Plot]

Plotting discrete data:

> data:=[seq([(i/10),(i/10)^2],i=0..10 )];
plot( data );

data := [[0, 0], [1/10, 1/100], [1/5, 1/25], [3/10, 9/100], [2/5, 4/25], [1/2, 1/4], [3/5, 9/25], [7/10, 49/100], [4/5, 16/25], [9/10, 81/100], [1, 1]]

[Plot]

> plot(data,style=point,symbol=diamond);

[Plot]

Building pictures up from graphics primitives:

> l:=plottools[line]([1,2],[3,1],color=black,thickness=4);
s:=plottools[rectangle]([1,2],[3,4],color=red);

p:=plottools[polygon]([seq([2+cos(2*Pi*i/5)/2,3+sin(2*Pi*i/5)/2],i=1..5)],color=blue);

plots[display](p,s,l,scaling=constrained);

l := CURVES([[1., 2.], [3., 1.]], COLOUR(RGB, 0, 0, 0), THICKNESS(4))

s := POLYGONS([[1., 2.], [3., 2.], [3., 4.], [1., 4.]], COLOUR(RGB, 1.00000000, 0., 0.))

p := POLYGONS([[2.154508497, 3.475528258], [1.595491503, 3.293892626], [1.595491503, 2.706107374], [2.154508497, 2.524471742], [2.500000000, 3.]], COLOUR(RGB, 0., 0., 1.00000000))p := POLYGONS([[2.154508497, 3.475528258], [1.595491503, 3.293892626], [1.595491503, 2.706107374], [2.154508497, 2.524471742], [2.500000000, 3.]], COLOUR(RGB, 0., 0., 1.00000000))

[Plot]

Animation:

> circs:=seq(plottools[circle]([1,2],i/10),i=1..10):
plots[display](circs);

plots[display](circs,insequence=true);

[Plot]

[Plot]

>