Plot := module() local maplet, Go, ClearLast, Clear, plotseq, oldplotseq, i, j ; export Display; j := 0; i := 0; oldplotseq[i] := plot(0,0..1,color=white, axes=none ); plotseq := NULL; use Maplets:-Elements in maplet := Maplet( Window( 'title' = "Parametric Plotter: Circles and Ellipses", [ Plotter[PL](height = 350, width = 350), [ Label("Enter in your parametric functions: ", 'font' = Font("times", 18))], [ Label("x(t) = ", 'font' = Font("times", bold, 18)), TextField[TF1]("cos(t)"), Label(" y(t) = ", 'font' = Font("times", bold, 18)), TextField[TF2]("sin(t)") ], [ " Plot from t = ", TextField[TF3]("0"), " to t = ", TextField[TF4]("2*Pi") , " " ], [ Button( "Plot", Evaluate( function = 'Go()' ) ), Button( "Clear Last", Evaluate( function = 'ClearLast()' ) ), Button( "Clear", Evaluate( function = 'Clear()' ) ), Button( "Exit", Shutdown() ) ] ]) ); end use; Display := proc() Maplets:-Display( maplet ); end proc; Clear := proc() j:= 0; i:= 0; plotseq := NULL; Maplets:-Tools:-Set( PL = plot(0,0..1,color=white, axes=none ) ); end proc; ClearLast := proc() if i = 1 then j:= 0; i:= 0; plotseq := NULL; Maplets:-Tools:-Set( PL = plot(0,0..1,color=white, axes=none ) ); else: j := i-1; i := j ; plotseq := oldplotseq[i]; try use Maplets:-Tools in Maplets:-Tools:-Set( PL = plots[display]( [plotseq ], scaling=constrained ) ); end use; catch: use Maplets in maplet := Maplet( [ "Error in Clear", Button( "OK", Shutdown() ) ] ); end use; Maplets:-Display( maplet ); end try; oldplotseq[i] := plotseq; end if: end proc; Go := proc() local maplet; j:= i+1; i:= j ; try use Maplets:-Tools in plotseq := plotseq, plot( [ Get( TF1::algebraic ), Get( TF2::algebraic ), t = Get( TF3::algebraic )..Get( TF4::algebraic ) ] ); Set( PL = plots[display]( [plotseq], scaling='CONSTRAINED' ) ); end use; catch: use Maplets in maplet := Maplet( [ "Your expression did not parse or there was a plotting error", Button( "OK", Shutdown() ) ] ); end use; Maplets:-Display( maplet ); end try; oldplotseq[i] := plotseq; end proc; end module: Plot:-Display( maplet );