plots
dualaxisplot
create a plot with two y-axes
Calling Sequence
Parameters
Description
Examples
dualaxisplot(expr1, expr2, xrange, opts)
dualaxisplot(p1, p2, mopts)
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.
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[2], 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[2] 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.
with⁡plots:
dualaxisplot⁡plot⁡sin,plot⁡cos
dualaxisplot⁡sin⁡x,cos⁡x,x=0..2⁢π
dualaxisplot⁡sin⁡x,cos⁡x,x=0..2⁢π,color=Blue,Green
dualaxisplot⁡plot⁡x2,x=0..10,labels=x,x2,legend=x2,plot⁡x3,x=0..10,color=blue,labels=x,x3,legend=x3,title=A Comparison
dualaxisplot⁡animate⁡plot,A⁢x3,color=blue,labels=x,x3,A=0..1,plot⁡x2,labels=x,x2
dualaxisplot⁡plot⁡sin,cos,tickmarks=default,3,axis2=color=red,plot⁡x2,tickmarks=default,11,color=black
The command to create the plot from the Plotting Guide is
dualaxisplot⁡inequal⁡0<x+y,x−y≤1,x=−3..3,y=−3..3,optionsexcluded=color=white,conformal⁡z2,z=0..2+2⁢I
See Also
plot
plot/interface
plots[display]
Download Help Document