StaticPlot - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.
Our website is currently undergoing maintenance, which may result in occasional errors while browsing. We apologize for any inconvenience this may cause and are working swiftly to restore full functionality. Thank you for your patience.

Online Help

All Products    Maple    MapleSim


DocumentTools[Canvas]

  

StaticPlot

  

create a canvas plot

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

StaticPlot(plot)

StaticPlot(plot, options)

Parameters

plot

-

2-D plot structure

options

-

(optional) name=value pairs

Description

• 

The StaticPlot command is used to render a plot inline in a shared canvas.  The plot argument is the result of a call to one of Maple's plot commands.

• 

The onclick option can be used to specify the name of a ScriptButton in the canvas description.  When a user clicks over the plot, then a global variable named _location will be set to the [x,y] coordinates of the click.  See the example below.  

• 

The custom option can be used to specify a string identifier that can later be used to locate the element using scripting commands and GetElements

• 

The scrollHorizontal truefalse option will set the default zoom mode in Maple Learn to apply only in the horizontal direction

• 

The scrollVertical truefalse option will set the default zoom mode in Maple Learn to apply only in the vertical direction

• 

The lockedView truefalse option, when true, will "lock" the view in Maple Learn so that subsequent curves added to the plot will not cause the view to change.  

• 

The lockedAspect truefalse option will set the aspect ration of the plot in Maple Learn to 1:1, similar to the constrained option for Maple plots.

• 

The showSpecial truefalse option turns on the "Show special points" feature for a live plot in Maple Learn.

  

Note: When viewed in a canvas in Maple, in order to enable click actions, you must use the plot click and drag manipulator tool ( ).  If not already selected, you can select this tool from the plotting toolbar.

Examples

withDocumentTools:-Canvas:

cvNewCanvasPlot Example,TextA plot of: %1,x+121,StaticPlotplotx+121:

ShareCanvascv

This example implements a click-on-plot action, such that a point appears on the plot where the cursor was when the plot was clicked.  Other script actions could be added as needed.

clickplot := proc( canvas )
   global _location;
   local elems := GetElements(canvas,"plot");
   local sc := Script();
   SetActive(sc,elems[1]);
   local plt := (
      if assigned(_location) then
          plots[pointplot](_location,view=[-1..1,-1..1]);
      else
          plots[textplot]([.5,.5,"click on plot"],view=[-1..1,-1..1]);
      end if);
   SetPlot(sc,plt);
   ToString(sc);
end proc:

cvNewCanvasTest Click-on-plot,StaticPlotplotstextplot0.5,0.5,click on plot,view=1..1,1..1,onclick=Reset,ScriptButtonReset,clickplot:

ShareCanvascv

Compatibility

• 

The DocumentTools[Canvas][StaticPlot] command was introduced in Maple 2021.

• 

For more information on Maple 2021 changes, see Updates in Maple 2021.

• 

The DocumentTools[Canvas][StaticPlot] command was updated in Maple 2022.

• 

The onclick option was introduced in Maple 2022.

• 

For more information on Maple 2022 changes, see Updates in Maple 2022.

• 

The custom, scrollHorizontal, scrollVertical, lockedView, lockedAspect and showSpecial options were introduced in Maple 2023.

• 

For more information on Maple 2023 changes, see Updates in Maple 2023.

See Also

Annotate

GetCanvas

Math

NewCanvas

Script

ShareCanvas

Text