0

There are two plots with same x-axis. The y-axis value for one plot is much smaller than the other. So plot#1 appears squashed compared to the other. I do not want to use a log scaling or any other type of scaling. How to create a secondary axis Show plot such that the scales for both Plot1 and Plot2 are displayed on either side?

Plot1 = Plot[{Sin[t]}, {t, -10, 10}] 
Plot2 = Plot[{500*Cos[t]}, {t, -10, 10}] 
Show[Plot1, Plot2]
RPlotter
  • 31
  • 4

1 Answers1

3
Clear["Global`*"]

ResourceFunction["MultipleAxesPlot"][{Sin[t], 500*Cos[t]}, {t, -10, 10}]

enter image description here

data = Transpose@Table[{{t, Sin[t]}, {t, 500*Cos[t]}}, {t, -10, 10, 1/10}];

ResourceFunction["MultipleAxesListPlot"][data, Joined -> True]

enter image description here

Or with ListLinePlot you can use MultiaxisArrangement

ListLinePlot[data,
 MultiaxisArrangement -> All]

enter image description here

Bob Hanlon
  • 157,611
  • 7
  • 77
  • 198