create a canvas plot
(optional) name=value pairs
The StaticPlot command is used to create a plot that will be rendered inline in a shared canvas. The expression argument is normally the result of a call to one of Maple's plot commands, but can also be a math formula that can be plotted by the plot command.
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.
cv ≔ NewCanvas⁡Plot Example,Text⁡A plot of: %1,x+12−1,StaticPlot⁡x+12−1:
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 )
local elems := GetElements(canvas,"plot");
local sc := Script();
local plt := (
if assigned(_location) then
plots[textplot]([.5,.5,"click on plot"],view=[-1..1,-1..1]);
cv ≔ NewCanvas⁡Test Click-on-plot,StaticPlot⁡plotstextplot⁡0.5,0.5,click on plot,view=−1..1,−1..1,'onclick'=Reset,ScriptButton⁡Reset,clickplot:
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.
Download Help Document