 display - Maple Help

Home : Support : Online Help : Graphics : 2-D : display

plots

 display
 display a list of plot structures Calling Sequence display(P) Parameters

 P - a set, list or Array (one- or two-dimensional) of plot structures, or an animation structure Options

 • insequence : boolean; specifies whether plots should be displayed in sequence as an animation
 • overrideoption : boolean; specifies whether options set in plots contained in P can be overridden with new options
 • redraw : boolean; specifies whether to allow redrawing of static 2-D plots by combining the original plot calls into a single call rather than just displaying them together Description

 • If P is an Array of plot structures, then a row or table of plots is displayed. P can contain a combination of 2-D and 3-D plots, including animations. This feature is described in more detail on the plot/arrayplot help page. The insequence and overrideoption options are not applicable in this case.
 • If P is an animation structure created by the plots:-animate command, then the frames are displayed in a tabular format, unless the insequence option is set to true, in which case the frames are displayed in sequence in an animation. The overrideoption option is not applicable in this case.
 • If P is a list or set of plot structures (created by any plotting command), the display command combines these structures into a single plot. If the insequence option is set to true, then an animation is created instead; the order of the plots is preserved only if P is a list. All elements in P must have the same dimension, as 2-D and 3-D plots cannot be combined except in the case where P is an Array as described above.
 • In situations where multiple plots are combined into a single plot, the display command attempts to merge options specified within the individual plot structures. If a conflict arises, such as different titles for two plots, an arbitrary choice is made.
 • Additional options as described in the plot/options and plot3d/option help pages may be provided if they are applicable. If the option is one that applies to the entire plot, such as the title or axes style, then the new option overrides any previously specified in the plots contained in P. However, options such as color or linestyle that apply to individual elements like curves or polygons do not affect previously set colors or linestyles. You must set overrideoption to true, to have a new option of this type override an existing one.
 • By default, a collection of 2-D static plots created using the plot command is converted to a single plot command and then redrawn. This redrawing allows the resulting plot to have enough data to fill the view despite component plots potentially having been computed for different views. The resulting plot can also be resized, zoomed, or panned via the interactive controls in the graphical interface without causing any gaps in the data being shown or requiring that the user re-execute any plot commands. As a result of this redrawing, some features of the component plots which were left unspecified may change. For example, plots with unspecified colors might have the same color when displayed individually but be shown with different colors when combined using plots[display]. This redrawing can be turned off by setting the option redraw to false. Sometimes it is not possible to combine a collection of plots into a single plot command without losing some crucial information. In such a case, the plots are only displayed together rather than redrawn. Notes

 • Usually, the plot structures allowed in P are those plots created through any of Maple's plotting commands.  For specific information about the plot structures themselves, see plot/structure. The display command itself creates a plot data structure.  The form of this structure may depend on the graphical interface.  For information about how display combines dual-axis plots, see the plots:-dualaxisplot help page.
 • Though the display command works with most plots and plotting options, there are some limitations.  For example, the command does not work with infinity plots.  (See plot/infinity.)  Also, a number of options, including legend, discont and adaptive, cannot be used as they must be applied when the plot is first created.
 • An animation can be displayed with background plots by putting them together in a list and setting the insequence option to false. An animation can also be saved as an animated GIF file.  For more information, see plot/device.
 • When creating an animation using the insequence option, especially when using the plot command to create the individual frames, it may be beneficial to apply certain options to achieve greater computational efficiency. In particular, you might consider using the adaptive=true option, and if you combine multiple plots for each frame, also the redraw=false option. These options are discussed in the plot/computation help page. Alternatively, if you use the plots[animate] command to create the same animation, it applies these options by default. Examples

 > $\mathrm{with}\left(\mathrm{plots}\right):$

Create plots for both cosine and tangent and display them together.

 > $F≔\mathrm{plot}\left(\mathrm{cos}\left(x\right),x=-\mathrm{Pi}..\mathrm{Pi},y=-\mathrm{Pi}..\mathrm{Pi},\mathrm{style}=\mathrm{line}\right):$
 > $G≔\mathrm{plot}\left(\mathrm{tan}\left(x\right),x=-\mathrm{Pi}..\mathrm{Pi},y=-\mathrm{Pi}..\mathrm{Pi},\mathrm{style}=\mathrm{point}\right):$
 > $\mathrm{display}\left(\left\{F,G\right\},\mathrm{axes}=\mathrm{boxed},\mathrm{scaling}=\mathrm{constrained},\mathrm{title}="Cosine and Tangent"\right)$ Change the color of the curves in the previous plot. Note that overrideoptions must be added.

 > $\mathrm{display}\left(\left\{F,G\right\},\mathrm{color}="Blue",\mathrm{overrideoptions},\mathrm{axes}=\mathrm{boxed},\mathrm{scaling}=\mathrm{constrained},\mathrm{title}="Cosine and Tangent"\right)$ You can also display 3-D plots together.

 > $F≔\mathrm{plot3d}\left(\mathrm{sin}\left(xy\right),x=-\mathrm{Pi}..\mathrm{Pi},y=-\mathrm{Pi}..\mathrm{Pi}\right):$
 > $G≔\mathrm{plot3d}\left(x+y,x=-\mathrm{Pi}..\mathrm{Pi},y=-\mathrm{Pi}..\mathrm{Pi}\right):$
 > $H≔\mathrm{plot3d}\left(\left[2\mathrm{sin}\left(t\right)\mathrm{cos}\left(s\right),2\mathrm{cos}\left(t\right)\mathrm{cos}\left(s\right),2\mathrm{sin}\left(s\right)\right],s=0..\mathrm{Pi},t=-\mathrm{Pi}..\mathrm{Pi}\right):$
 > $\mathrm{display}\left(\left\{F,G,H\right\}\right)$ The following example displays two animations on the same plot.

 > $P≔\mathrm{animate}\left(\mathrm{plot},\left[\mathrm{sin}\left(x+t\right),x=-\mathrm{Pi}..\mathrm{Pi},\mathrm{color}="Red"\right],t=-\mathrm{Pi}..\mathrm{Pi},\mathrm{frames}=8\right):$
 > $Q≔\mathrm{animate}\left(\mathrm{plot},\left[\mathrm{cos}\left(x+t\right),x=-\mathrm{Pi}..\mathrm{Pi},\mathrm{color}="Green"\right],t=-\mathrm{Pi}..\mathrm{Pi},\mathrm{frames}=8\right):$
 > $\mathrm{display}\left(\left[P,Q\right]\right)$ Using the insequence=true option, P is displayed, then Q.

 > $P≔\mathrm{animate}\left(\mathrm{plot3d},\left[x-ky+1,x=-10..10,y=-10..10\right],k=-10..0,\mathrm{frames}=4\right):$
 > $Q≔\mathrm{animate}\left(\mathrm{plot3d},\left[x-ky+1,x=-10..10,y=-10..10\right],k=0..10,\mathrm{frames}=4\right):$
 > $\mathrm{display}\left(\left[P,Q\right],\mathrm{insequence}=\mathrm{true}\right)$ > $P≔\mathrm{animate}\left(\mathrm{plot3d},\left[\mathrm{cos}\left(tx\right)\mathrm{sin}\left(ty\right),x=-\mathrm{Pi}..\mathrm{Pi},y=-\mathrm{Pi}..\mathrm{Pi}\right],t=1..2,\mathrm{frames}=4\right):$
 > $Q≔\mathrm{animate}\left(\mathrm{plot3d},\left[x\mathrm{cos}\left(tu\right),x=1..3,t=1..4\right],u=2..4,\mathrm{coords}=\mathrm{spherical},\mathrm{frames}=4\right):$
 > $\mathrm{display}\left(\left[P,Q\right]\right)$ This example illustrates how to animate with a background.

 > $a≔\mathrm{animate}\left(\mathrm{plot3d},\left[\mathrm{cos}\left(tx\right)\mathrm{sin}\left(ty\right),x=-\mathrm{Pi}..2\mathrm{Pi},y=-\mathrm{Pi}..2\mathrm{Pi}\right],t=1..2\right):$
 > $b≔\mathrm{plot3d}\left({1.3}^{x}\mathrm{sin}\left(y\right),x=-1..2\mathrm{Pi},y=0..\mathrm{Pi},\mathrm{coords}=\mathrm{spherical}\right):$
 > $c≔\mathrm{plot3d}\left(\mathrm{binomial},0..5,0..5\right):$
 > $\mathrm{display}\left(\left\{b,a,c\right\}\right)$ You can animate the Taylor approximation of the sine function. In the following example nine frames are used.

 > $f≔\mathrm{sin}:$$n≔9:$

Construct a Taylor approximation animation which consists of the nine frames previously specified.

 > $A≔\mathrm{display}\left(\mathrm{seq}\left(\mathrm{plot}\left(\mathrm{convert}\left(\mathrm{taylor}\left(f\left(x\right),x=0,3i\right),\mathrm{polynom}\right),x=-3\mathrm{Pi}..3\mathrm{Pi},y=-1..1,\mathrm{style}=\mathrm{line},\mathrm{axes}=\mathrm{none}\right),i=1..n\right),\mathrm{insequence}=\mathrm{true}\right):$

Construct the original function which is sine.

 > $B≔\mathrm{animate}\left(\mathrm{plot},\left[f\left(x\right),x=-3\mathrm{Pi}..3\mathrm{Pi}\right],y=-1..1,\mathrm{frames}=n,\mathrm{style}=\mathrm{point},\mathrm{axes}=\mathrm{none}\right):$

Now display both together, frame by frame. The solid animated line is A. The stationary dotted line is B.

 > $\mathrm{dis}≔\mathrm{display}\left(A,B,\mathrm{view}=\left[-3\mathrm{Pi}..3\mathrm{Pi},-1..1\right]\right):$
 > $\mathrm{dis}$  Compatibility

 • The plots[display] command was updated in Maple 2022.
 • The redraw option was introduced in Maple 2022.