I need to plot the data in a dual-axis chart.
Are there any examples or instructions?
How do the axis scales and labels place on the left and right?
a = {100, 200, 300, 400, 500};
b = {1, 2, 3, 4, 5};
ListPlot[{a, b}]
I need to plot the data in a dual-axis chart.
Are there any examples or instructions?
How do the axis scales and labels place on the left and right?
a = {100, 200, 300, 400, 500};
b = {1, 2, 3, 4, 5};
ListPlot[{a, b}]
Hi Tsai,
It is unfortunate that WL has no built-in way to do this as far as I know. Here is one workaround.
plot1 = ListPlot[a,
ImageSize -> 400,
ImagePadding -> 40,
PlotStyle -> ColorData[97](https://community.wolfram.com//c/portal/getImageAttachment?filename=2956plot.png&userId=1398218),
Frame -> {True, True, True, False},
FrameStyle -> {Automatic, ColorData[97](https://community.wolfram.com//c/portal/getImageAttachment?filename=2956plot.png&userId=1398218), Automatic, Automatic},
FrameLabel -> {{"Plot a", None}, {None, None}}];
plot2 = ListPlot[b,
ImageSize -> 400,
ImagePadding -> 40,
PlotRange -> {0, 10},
PlotStyle -> ColorData[97][2],
Frame -> {False, False, False, True},
FrameStyle -> {Automatic, Automatic, Automatic, ColorData[97][2]},
FrameTicks -> {{False, All}, {False, False}},
FrameLabel -> {{None, "Plot b"}, {None, None}}];
Overlay[{plot1, plot2}]
Thank you very much for your help !
I hope that there will be built-in functions for the next update.
This may help you:
https://resources.wolframcloud.com/FunctionRepository/resources/CombinePlots
I think this is what you are looking for?
https://resources.wolframcloud.com/FunctionRepository/resources/MultipleAxesListPlot
I never knew there was this resource~~~~ Thank you very much.