 plots - Maple Programming Help

Home : Support : Online Help : Graphics : Packages : plots : plots/dualaxisplot

plots

 dualaxisplot
 create a plot with two y-axes

 Calling Sequence dualaxisplot(expr1, expr2, xrange, opts) dualaxisplot(p1, p2, mopts)

Parameters

 expr1, expr2 - expressions or procedures xrange - x-range specification p1, p2 - PLOT structures created by Maple plotting commands opts - (optional) plotting options to be passed to the plot command mopts - (optional) plotting options to be merged with PLOT structures.

Description

 • The dualaxisplot command creates a plot with two y-axes located at the left and right sides of the plot.  The y-axis at the left is considered the primary axis and is associated with the first plot given in the calling sequence.
 • In the first calling sequence, expr1 and expr2 are two expressions or procedures.  Each expression or procedure is passed to the plot command, along with the x-range specification and any plotting options, to create the plot objects in the dual-axis plot.
 • Plot options as described on the plot/options help page may be given with the first calling sequence.  A limited number of options (axis, color, legend, linestyle, symbol, symbolsize, thickness and transparency) may be given a list of two values. For example, thickness = [1, 2] means apply thickness = 1 to the first expression and thickness = 2 to the second.  Note that each value for the axis option must itself be a list, as described on the plot/axis help page.
 • In the second calling sequence, p1 and p2 are PLOT structures generated by Maple plotting commands.  This calling sequence is particularly useful when you wish to combine plots created with commands other than the plot command, such as the plots[display] or plots[animate] commands.
 • Options may be provided with the second calling sequence as well. Because this calling sequence uses fully formed PLOT structures, the new options are merged into the structures using the plots[display] command. Most of the options described on the plot/options page are allowed but, unlike the first calling sequence, only single values may be given. If different option values are desired for each plot, they should be specified when the individual plot structures are being created. Note that additional options are not merged with animations.
 • Plots generated by the dualaxisplot command may be combined using the plots[display] command.  Elements associated with the left y-axis in both plots are grouped together in the new plot, and similarly for elements associated with the right y-axis.  If a dual-axis plot is combined with a regular plot, then the elements of the regular plot are associated with the left y-axis in the resulting plot.
 • If the two plots have options that conflict, such as two different titles, then the option associated with the primary plot (the one associated with the left y-axis) is used. When constrained scaling is requested, it is also applied to the primary plot.
 • Dual-axis plots are not available for all interfaces and devices. For more information, see plot/interface.

Examples

 > $\mathrm{with}\left(\mathrm{plots}\right):$
 > $\mathrm{dualaxisplot}\left(\mathrm{plot}\left(\mathrm{sin}\right),\mathrm{plot}\left(\mathrm{cos}\right)\right)$ > $\mathrm{dualaxisplot}\left(\mathrm{sin}\left(x\right),\mathrm{cos}\left(x\right),x=0..2\mathrm{Pi}\right)$ > $\mathrm{dualaxisplot}\left(\mathrm{sin}\left(x\right),\mathrm{cos}\left(x\right),x=0..2\mathrm{Pi},\mathrm{color}=\left["Blue","Green"\right]\right)$ > $\mathrm{dualaxisplot}\left(\mathrm{plot}\left({x}^{2},x=0..10,\mathrm{labels}=\left[x,{x}^{2}\right],\mathrm{legend}={x}^{2}\right),\mathrm{plot}\left({x}^{3},x=0..10,\mathrm{color}=\mathrm{blue},\mathrm{labels}=\left[x,{x}^{3}\right],\mathrm{legend}={x}^{3}\right),\mathrm{title}="A Comparison"\right)$ > $\mathrm{dualaxisplot}\left(\mathrm{animate}\left(\mathrm{plot},\left[A{x}^{3},\mathrm{color}=\mathrm{blue},\mathrm{labels}=\left[x,{x}^{3}\right]\right],A=0..1\right),\mathrm{plot}\left({x}^{2},\mathrm{labels}=\left[x,{x}^{2}\right]\right)\right)$ > $\mathrm{dualaxisplot}\left(\mathrm{plot}\left(\left[\mathrm{sin},\mathrm{cos}\right],\mathrm{tickmarks}=\left[\mathrm{default},3\right],{\mathrm{axis}}_{2}=\left[\mathrm{color}=\mathrm{red}\right]\right),\mathrm{plot}\left({x}^{2},\mathrm{tickmarks}=\left[\mathrm{default},11\right],\mathrm{color}=\mathrm{black}\right)\right)$ The command to create the plot from the Plotting Guide is

 > $\mathrm{dualaxisplot}\left(\mathrm{inequal}\left(\left\{x-y\le 1,0 