Inline Plot - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

DocumentTools[Layout]

 InlinePlot
 generate XML for an InlinedPlot element

 Calling Sequence InlinePlot( p, opts )

Parameters

 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

Options

 • 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.

Description

 • 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.

Examples

 > $\mathrm{with}\left(\mathrm{DocumentTools}\right):$
 > $\mathrm{with}\left(\mathrm{DocumentTools}:-\mathrm{Layout}\right):$

Executing the InlinePlot command produces a function call, in which the supplied plot structure p has been encoded.

 > $p≔\mathrm{plot}\left(\mathrm{sin}\left(x\right),x=0..\mathrm{\pi },\mathrm{adaptive}=\mathrm{false},\mathrm{numpoints}=5\right):$
 > $P≔\mathrm{InlinePlot}\left(p\right)$
 ${P}{≔}{\mathrm{_XML_Plot}}{}\left({"gridlinevisibility"}{=}{"0"}{,}{"height"}{=}{"500"}{,}{"legendvisibility"}{=}{"false"}{,}{"plot-scale"}{=}{"1.0"}{,}{"type"}{=}{"two-dimensional"}{,}{"width"}{=}{"500"}{,}{"plot-xtrans"}{=}{"0."}{,}{"plot-ytrans"}{=}{"0."}{,}{"input"}{=}{"_ATTRIBUTE\left("input" = \left[TABLE\left(1 = plot,2 = \left[sin\left(x\right)\right],3 = \left(x = 0 .. Pi\right),4 = \left(numpoints = 5\right),5 = \left(adaptive = false\right)\right), "originalview" = \left[0. .. 3.14159265044999980, 0. .. .999419429119358771\right], "originalaxesticks" = AXESTICKS\left(_PITICKS,DEFAULT,_ATTRIBUTE\left("source" = "mathdefault"\right)\right)\right]\right)"}{,}{"LUklUExPVEc2JCUqcHJvdGVjdGVkRyUoX3N5c2xpYkc2Ji1JJ0NVUlZFU0c2JEYlRiY2JFgsJSlhbnl0aGluZ0c2IkYuW2dsJyIlISEhIysiJiIjMDAwMDAwMDAwMDAwMDAwMDNGRUE0QkEzQkUxNzlFMjMzRkY4OTY2NkQxMkE1QjY4NDAwMkI5RjJGNzZENzgzNjQwMDkyMUZCNTNEODRCMkUwMDAwMDAwMDAwMDAwMDAwM0ZFNzZGMzk5NDE2N0Q1NjNGRUZGQjNFNzQ2MUJGOTQzRkU2RjkyMTEyNzU4ODYyM0UyQUY4N0E5MUE2MjYzMy1JJ0NPTE9VUkc2JEYlRiY2J0kkUkdCRzYkRiVGJiQiKUMpZXElISIpJCIiIUY5JCIpaD4hXCYhIiotJStfQVRUUklCVVRFRzYjL1Enc291cmNlRi5RLG1hdGhkZWZhdWx0Ri4tSStBWEVTTEFCRUxTRzYkRiVGJjYkJSJ4R1EhRi4tSSpBWEVTVElDS1NHNiRGJUYmNiUlKV9QSVRJQ0tTR0koREVGQVVMVEc2JEYlRiZGPS1JJVZJRVdHNiRGJUYmNiU7RjgkIitdRWZUSkY8Rk5GPQ=="}\right)$ (1)

By using additional commands from the Layout Constructors package a nested function call can be produced which represents an entire worksheet.

 > $\mathrm{xml}≔\mathrm{Worksheet}\left(\mathrm{Group}\left(\mathrm{Input}\left(\mathrm{Textfield}\left(P\right)\right)\right)\right):$

That XML representation of a worksheet can be inserted directly.

 > $\mathrm{InsertContent}\left(\mathrm{xml}\right):$

The height and width options can be used to control the displayed dimensions of both 2D and 3D plots.

 > $p≔\mathrm{plot}\left(\mathrm{sin}\left(x\right){x}^{2},x=-2\mathrm{\pi }..2\mathrm{\pi }\right):$
 > $P≔\mathrm{InlinePlot}\left(p,\mathrm{height}=200,\mathrm{width}=500\right):$
 > $\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(\mathrm{Group}\left(\mathrm{Input}\left(\mathrm{Textfield}\left(P\right)\right)\right)\right)\right):$

 > $p≔\mathrm{plot3d}\left(\mathrm{sin}\left(x\right){y}^{2},x=-2\mathrm{\pi }..2\mathrm{\pi },y=-1..1\right):$
 > $P≔\mathrm{InlinePlot}\left(p,\mathrm{height}=200,\mathrm{width}=300\right):$
 > $\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(\mathrm{Group}\left(\mathrm{Input}\left(\mathrm{Textfield}\left(P\right)\right)\right)\right)\right):$

The size option used in constructing a 2D plot, when specifying width and height as positive integer pixel values, is respected by default.

 > $p≔\mathrm{plot}\left(\mathrm{sin}\left(x\right){x}^{2},x=-2\mathrm{\pi }..2\mathrm{\pi },\mathrm{size}=\left[500,300\right]\right):$
 > $P≔\mathrm{InlinePlot}\left(p\right):$
 > $\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(\mathrm{Group}\left(\mathrm{Input}\left(\mathrm{Textfield}\left(P\right)\right)\right)\right)\right):$

A legend in a 2D plot is made visible by default.

 > $p≔\mathrm{plot}\left(\mathrm{sin}\left(x\right){x}^{2},x=-2\mathrm{\pi }..2\mathrm{\pi },\mathrm{legend}=\mathrm{typeset}\left(\mathrm{sin}\left(x\right){x}^{2}\right),\mathrm{size}=\left[200,200\right]\right):$
 > $\mathrm{P1}≔\mathrm{InlinePlot}\left(p\right):$$\mathrm{P2}≔\mathrm{InlinePlot}\left(p,\mathrm{legendvisibility}=\mathrm{false}\right):$
 > $\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(\mathrm{Table}\left(\mathrm{Row}\left(\mathrm{P1},\mathrm{P2}\right)\right)\right)\right):$

The initial pan and scale of a 3D plot can be controlled by options.

 > $p≔\mathrm{plot3d}\left({x}^{2}+{y}^{2},x=-1..1,y=-1..1\right):$
 > $\mathrm{P1}≔\mathrm{InlinePlot}\left(p\right):$
 > $\mathrm{P2}≔\mathrm{InlinePlot}\left(p,\mathrm{xtrans}=10.0,\mathrm{ytrans}=5.0\right):$
 > $\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(\mathrm{Group}\left(\mathrm{Input}\left(\mathrm{Textfield}\left(\mathrm{P1},\mathrm{P2}\right)\right)\right)\right)\right):$

 > $p≔\mathrm{plot3d}\left({x}^{2}+{y}^{2},x=-1..1,y=-1..1\right):$
 > $\mathrm{P1}≔\mathrm{InlinePlot}\left(p\right):$
 > $\mathrm{P2}≔\mathrm{InlinePlot}\left(p,\mathrm{scale}=1.5\right):$
 > $\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(\mathrm{Group}\left(\mathrm{Input}\left(\mathrm{Textfield}\left(\mathrm{P1},\mathrm{P2}\right)\right)\right)\right)\right):$

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.

 > $\mathrm{pg}≔\mathrm{plot}\left(\mathrm{sin},\mathrm{gridlines}=\mathrm{true}\right):$
 > $\mathrm{pn}≔\mathrm{plot}\left(\mathrm{sin},\mathrm{gridlines}=\mathrm{false}\right):$
 > T≔\mathrm{Table}\left(\mathrm{widthmode}=\mathrm{pixels},\mathrm{width}=300,\mathrm{alignment}=\mathrm{center},\mathrm{Row}\left(\mathrm{InlinePlot}\left(\mathrm{pn},\mathrm{gridlinevisibility}=\mathrm{true}\right),\mathrm{InlinePlot}\left(\mathrm{pn},\mathrm{gridlinevisibility}=\mathrm{false}\right)\right),\mathrm{Row}\left(\mathrm{InlinePlot}\left(\mathrm{pg},\mathrm{gridlinevisibility}=\mathrm{true}\right),\mathrm{InlinePlot}\left(\mathrm{pg},\mathrm{gridlinevisibility}=\mathrm{false}\right)\right)\right):
 > $\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(T\right)\right):$

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≔\mathrm{InlinePlot}\left(\mathrm{plot3d}\left({x}^{2}\mathrm{sin}\left(y\right),x=-1..1,y=-2\mathrm{\pi }..2\mathrm{\pi },\mathrm{axis}=\left[\mathrm{color}=\mathrm{cyan}\right],\mathrm{labels}=\left["","",""\right]\right)\right):$$C≔\mathrm{Cell}\left(\mathrm{Textfield}\left(P\right),\mathrm{fillcolor}="black"\right):$T≔\mathrm{Table}\left(\mathrm{Column}\left(\right),\mathrm{Row}\left(C\right),\mathrm{widthmode}=\mathrm{pixels},\mathrm{width}=300,\mathrm{alignment}=\mathrm{center}\right):
 > $\mathrm{InsertContent}\left(\mathrm{Worksheet}\left(T\right)\right):$

Compatibility

 • 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.