How to | Generate Plots with Two Vertical Scales

Suppose two functions have the same domain and different ranges. Plotting them together using Plot uses the same scale for the values. To compare the functions, TwoAxisPlot plots them with different scales for the values (on the left and right) so that their ranges appear to be the same.

Here it is not obvious whether there is a simple relation between the two functions:

The custom function defined here, TwoAxisPlot, rescales two plots to appear to have the same range. The ranges of the functions are shown on the left and right sides of the frame:

The combined plot illustrates the fact that for some and :

  • Basic Plotting
  • Options for Graphics
  • Redrawing and Combining Plots
  • Editing Wolfram Language Graphics
  • How to: Align Plots with Each Other
  • How to: Customize Plots and Graphics
  • How to: Create Plots
  • Plot  Graphics  Show

  • Graphics Options & Styling
  • Plotting and Image Regions
  • Graphics Shape & Size
  • Graphics Annotation & Appearance
  • "How to" Topics