DocumentTools[Layout]
InlinePlot
generate XML for an InlinedPlot element
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
InlinePlot( p, opts )
p
-
(optional) ; content for the InlinedPlot element, such as the result of a plotting command
opts
(optional) ; one or more keyword options as described below
gridlinevisibility truefalse:=true ; Specifies whether gridlines are visible, if present in the plot content.
height : {posint,identical(NoUserValue)}:=NoUserValue ; The height in pixels. If height is NoUserValue and p is a 2D plot constructed with the size option specifying a positive pixel value for height then that value is used for height. Otherwise the default value is 500.
legendvisibility {truefalse,identical(NoUserValue)}:=NoUserValue ; Specifies whether a legend may be visible. The default behavior is for the legend to be visible if any legend is present for any curve or other constituent of p. The option values true and false override the default.
scale : realcons:=1.0 ; The scaling factor for 3D plots, a positive real value.
width : {posint,identical(NoUserValue)}:=NoUserValue ; The width in pixels. If width is NoUserValue and p is a 2D plot constructed with the size option specifying a positive pixel value for width then that value is used for width. Otherwise the default value is 500.
xtrans : realcons:=0.0 ; The horizontal translation for 3D plots, in units of 10 pixels.
ytrans : realcons:=0.0 ; The vertical translation for 3D plots, in units of 10 pixels.
The InlinePlot command in the Layout Constructors package returns an XML function call which represents a InlinedPlot element of a worksheet.
An InlinedPlot element is used to display a plot inlined within a Document or Worksheet.
The generated XML may be used with the results of other commands in the Layout Constructors package to create an entire Worksheet or Document in XML form. Such a representation of a Worksheet or Document may be inserted into the current document using the InsertContent command.
For construction of a PlotComponent see the Plot Component command.
with⁡DocumentTools:
with⁡DocumentTools:-Layout:
Executing the InlinePlot command produces a function call, in which the supplied plot structure p has been encoded.
p≔plot⁡sin⁡x,x=0..π,adaptive=false,numpoints=5:
P≔InlinePlot⁡p
P≔_XML_Plot⁡gridlinevisibility=0,height=500,legendvisibility=false,plot-scale=1.0,type=two-dimensional,width=500,plot-xtrans=0.,plot-ytrans=0.,input=_ATTRIBUTE("input" = [TABLE(1 = plot,2 = [sin(x)],3 = (x = 0 .. Pi),4 = (numpoints = 5),5 = (adaptive = false)), "originalview" = [0. .. 3.14159265044999980, 0. .. .999419429119358771], "originalaxesticks" = AXESTICKS(_PITICKS,DEFAULT,_ATTRIBUTE("source" = "mathdefault"))]),LUklUExPVEc2JCUqcHJvdGVjdGVkRyUoX3N5c2xpYkc2Ji1JJ0NVUlZFU0c2JEYlRiY2JFgsJSlhbnl0aGluZ0c2IkYuW2dsJyIlISEhIysiJiIjMDAwMDAwMDAwMDAwMDAwMDNGRUE0QkEzQkUxNzlFMjMzRkY4OTY2NkQxMkE1QjY4NDAwMkI5RjJGNzZENzgzNjQwMDkyMUZCNTNEODRCMkUwMDAwMDAwMDAwMDAwMDAwM0ZFNzZGMzk5NDE2N0Q1NjNGRUZGQjNFNzQ2MUJGOTQzRkU2RjkyMTEyNzU4ODYyM0UyQUY4N0E5MUE2MjYzMy1JJ0NPTE9VUkc2JEYlRiY2J0kkUkdCRzYkRiVGJiQiKUMpZXElISIpJCIiIUY5JCIpaD4hXCYhIiotJStfQVRUUklCVVRFRzYjL1Enc291cmNlRi5RLG1hdGhkZWZhdWx0Ri4tSStBWEVTTEFCRUxTRzYkRiVGJjYkJSJ4R1EhRi4tSSpBWEVTVElDS1NHNiRGJUYmNiUlKV9QSVRJQ0tTR0koREVGQVVMVEc2JEYlRiZGPS1JJVZJRVdHNiRGJUYmNiU7RjgkIitdRWZUSkY8Rk5GPQ==
By using additional commands from the Layout Constructors package a nested function call can be produced which represents an entire worksheet.
xml≔Worksheet⁡Group⁡Input⁡Textfield⁡P:
That XML representation of a worksheet can be inserted directly.
InsertContent⁡xml:
The height and width options can be used to control the displayed dimensions of both 2D and 3D plots.
p≔plot⁡sin⁡x⁢x2,x=−2⁢π..2⁢π:
P≔InlinePlot⁡p,height=200,width=500:
InsertContent⁡Worksheet⁡Group⁡Input⁡Textfield⁡P:
p≔plot3d⁡sin⁡x⁢y2,x=−2⁢π..2⁢π,y=−1..1:
P≔InlinePlot⁡p,height=200,width=300:
The size option used in constructing a 2D plot, when specifying width and height as positive integer pixel values, is respected by default.
p≔plot⁡sin⁡x⁢x2,x=−2⁢π..2⁢π,size=500,300:
P≔InlinePlot⁡p:
A legend in a 2D plot is made visible by default.
p≔plot⁡sin⁡x⁢x2,x=−2⁢π..2⁢π,legend=typeset⁡sin⁡x⁢x2,size=200,200:
P1≔InlinePlot⁡p:P2≔InlinePlot⁡p,legendvisibility=false:
InsertContent⁡Worksheet⁡Table⁡Row⁡P1,P2:
The initial pan and scale of a 3D plot can be controlled by options.
p≔plot3d⁡x2+y2,x=−1..1,y=−1..1:
P1≔InlinePlot⁡p:
P2≔InlinePlot⁡p,xtrans=10.0,ytrans=5.0:
InsertContent⁡Worksheet⁡Group⁡Input⁡Textfield⁡P1,P2:
P2≔InlinePlot⁡p,scale=1.5:
The gridlinevisibility option only controls whether gridlines present in a plot will be visible. Supplying the gridlinevisibility option will not by itself cause gridlines to be added to a plot result.
pg≔plot⁡sin,gridlines=true:
pn≔plot⁡sin,gridlines=false:
T≔Table⁡widthmode=pixels,width=300,alignment=center,Row⁡InlinePlot⁡pn,gridlinevisibility=true,InlinePlot⁡pn,gridlinevisibility=false,Row⁡InlinePlot⁡pg,gridlinevisibility=true,InlinePlot⁡pg,gridlinevisibility=false:
InsertContent⁡Worksheet⁡T:
Using a fill color on a Cell is an effective way to show a 3D plot with a black background. The next example uses the InlinePlot element constructor for the content of the Cell.
P≔InlinePlot⁡plot3d⁡x2⁢sin⁡y,x=−1..1,y=−2⁢π..2⁢π,axis=color=cyan,labels=,,:C≔Cell⁡Textfield⁡P,fillcolor=black:T≔Table⁡Column⁡,Row⁡C,widthmode=pixels,width=300,alignment=center:
The DocumentTools:-Layout:-InlinePlot command was introduced in Maple 2015.
For more information on Maple 2015 changes, see Updates in Maple 2015.
The height and width options were updated in Maple 2020.
See Also
Component Constructors
DocumentTools
InsertContent
Layout Constructors
Plot Component
XMLTools
Download Help Document