Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
A version of ListPlot that displays two lists of data with different y axes
ResourceFunction["MultipleAxesListPlot"][{data1,data2}] generates a plot of the data with two y axes. |
Plot two datasets together but with different y-axes:
| In[1]:= |
| Out[1]= | ![]() |
Data can be a one-dimensional list or pairs of {x,y}-values:
| In[2]:= | ![]() |
| Out[2]= | ![]() |
To make clearer which axis refers to which line, you can use "SecondaryAxesColor":
| In[3]:= | ![]() |
| Out[3]= | ![]() |
You can control the plot ranges of the two lines using PlotRange and "SecondaryPlotRange":
| In[4]:= | ![]() |
| Out[4]= | ![]() |
PlotRangePadding applies to both datasets, but uses the coordinate system of the first dataset:
| In[5]:= | ![]() |
| Out[5]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License