Note: I'm running Mathematica 9.0, which is quite an old version. But I'd like potential answers to be applicable to Mathematica 9.0, if possible.
In the following example, I have two ListPlot objects, myPlot1 and myPlot2. Each has PlotRange -> All to show all of the points.
How can I extract the PlotRange parameters from myPlot1? My goal is to give myPlot2 the same PlotRange parameters as myPlot1 without knowing those parameters a priori.
myPts1 = Table[{x, 2.333*Sin[x]}, {x, -2 Pi, 2 Pi, 2 Pi/50}];
myPts2 = Table[{x, Sin[x]}, {x, -2 Pi, 2 Pi, 2 Pi/50}];
imageSize = 300;
myPlot1 =
ListPlot[myPts1, PlotRange -> All, Joined -> True, Frame -> True,
FrameLabel -> {"x", "y"}, PlotStyle -> Red, ImageSize -> imageSize];
myPlot2 =
ListPlot[myPts2, PlotRange -> All, Joined -> True, Frame -> True,
FrameLabel -> {"x", "y"}, PlotStyle -> Blue,
ImageSize -> imageSize];
Grid[{{
myPlot1, myPlot2
}}]




