Maplets[Elements]
Plotter
define a 2-D or 3-D plot viewer
Calling Sequence
Parameters
Description
Examples
Plotter(opts)
Plotter[refID](opts)
opts
-
equation(s) of the form option=value where option is one of background, continuous, delay, frame_backwards, frame_forward, height, pause, play, reference, `stop`, to_end, to_start, tooltip, value, visible, or width; specify options for the Plotter element
refID
name or string; reference to the element
The Plotter window body element defines a plot viewer in a Maplet application. Both 2-D and 3-D plots and animations can be displayed in a Plotter element.
The Plotter element features can be modified by using options. To simplify specifying options in the Maplets package, certain options and contents can be set without using an equation. The following table lists elements, symbols, and types (in the left column) and the corresponding option or content (in the right column) to which inputs of this type are, by default, assigned.
Elements, Symbols, or Types
Assumed Option or Content
Maple 2-D or 3-D plot
value option
reference option
string or symbol
tooltip option
A Plotter element cannot contain other elements.
A Plotter element can be contained in a Maplet or BoxLayout element, or Maplet element in a nested list representing a box layout.
The following table describes the control and use of the Plotter element options.
An x in the I column indicates that the option can be initialized, that is, specified in the calling sequence (element definition).
An x in the R column indicates that the option is required in the calling sequence.
An x in the G column indicates that the option can be read, that is, retrieved by using the Get tool.
An x in the S column indicates that the option can be written, that is, set by using the SetOption element or the Set tool.
Option
I
R
G
S
background
x
continuous
delay
frame_backwards
frame_forward
height
pause
play
reference
`stop`
to_end
to_start
tooltip
value
visible
width
The opts argument can contain one or more of the following equations that set Maplet application options.
background = color
The background color of the Maplet application. This can be a recognized color name, an RGB color structure, or a string of the form "#RRGGBB" where each pair is a two-digit hexadecimal number.
height = posint
The height of the plot viewer in pixels. By default, the height is 400 pixels.
reference = name or string
A reference for the Plotter element.
If the reference is specified by both an index, for example, Plotter[refID], and a reference in the calling sequence, the index reference takes precedence.
tooltip = symbol or string
The text that appears in the tooltip help window.
value = specfunc(anything, {PLOT, PLOT3D})
A Maple plot structure. This can be the output of plot, plot3d, or any other plotting routine, or any user-defined PLOT or PLOT3D structure.
visible = true or false
Whether the plot viewer is visible to the user. By default, the value is true.
width = posint
The width of the plot viewer in pixels. By default, the width is 400 pixels.
The following equations to the opts argument control plot animations.
continuous = true or false
If set to true, the animation plays continuously. If set to false, the animation stops after displaying all the frames once. By default, this option is set to true.
delay = posint
The delay in milliseconds between frames. The default value for this option is 100.
frame_backwards = true
Setting this parameter to true displays the previous frame in the sequence. If the animation is in progress it stops first.
frame_forward = true
Setting this parameter to true displays the next frame in the sequence. If the animation is in progress it stops first.
pause = true
Setting this parameter to true pauses the animation. It can be resumed by using the following play option.
play = true
Setting this parameter to true starts the animation (or resumes it if previously paused). By default, this option is set to false.
`stop` = true
Setting this parameter to true stops the animation. Because stop is also a keyword, you must use left single quotes (back quotes) (` `) to refer to this option.
to_end = true
Setting this parameter to true displays the last frame of the animation. If the animation is in progress it stops first.
to_start = true
Setting this parameter to true displays the first frame of the animation. If the animation is in progress it stops first.
A Maplet application that plots functions of 'x':
with⁡MapletsElements:
maplet2d≔Maplet⁡Enter a function of 'x':,TextFieldTF2d⁡sin(x),PlotterPL1⁡plot⁡sin⁡x,x=0..10,Button⁡Plot,Evaluate⁡PL1=plot⁡TF2d,x=0..10,Button⁡OK,Shutdown⁡TF2d:
result≔MapletsDisplay⁡maplet2d
A Maplet application that plots functions of 'x' and 'y':
maplet3d≔Maplet⁡Enter a function of 'x' and 'y':,TextFieldTF3d⁡,PlotterPL1⁡,Button⁡Plot,Evaluate⁡PL1=plot3d⁡TF3d,x=0..10,y=0..10,Button⁡OK,Shutdown⁡TF3d:
result≔MapletsDisplay⁡maplet3d
A simple Maplet application demonstrating the animation capabilities:
with⁡MapletsElements
p≔plotsanimate⁡plot,a⁢x+2⁢a,x=−10..10,a=−5..5,frames=20:
animator≔Maplet⁡PlotterP⁡p,continuous=false,Button⁡play,SetOption⁡P⁡play=true,Button⁡stop,SetOption⁡P⁡`stop`=true,Button⁡pause,SetOption⁡P⁡pause=true,Button⁡to start,SetOption⁡P⁡to_start=true,Button⁡to end,SetOption⁡P⁡to_end=true,Button⁡backwards,SetOption⁡P⁡frame_backwards=true,Button⁡forward,SetOption⁡P⁡frame_forward=true,continuous,CheckBoxCONTINUOUS⁡value=false,onchange=SetOption⁡target=P,`option`=continuous,Argument⁡CONTINUOUS,delay,SliderDELAY⁡100..500,200,filled=true,showticks,majorticks=100,minorticks=50,onchange=SetOption⁡target=P,`option`=delay,Argument⁡DELAY,Button⁡ok,Shutdown⁡:
Maplets:-Display⁡animator
See Also
Maplets/WindowBodyElements
Maplets[Display]
Maplets[Elements][Evaluate]
Maplets[Elements][Maplet]
Maplets[Elements][SetOption]
Maplets[Elements][Shutdown]
Maplets[Elements][TextField]
Maplets[Tools][Get]
Maplets[Tools][Set]
Overview of Maplet Applications
plot
plot/structure
plot3d
plots[animate]
Download Help Document