I'm running into a strange issue with ListPlot.
I'm trying to plot some data with particular values for PlotRange, PlotLabels, and AspectRatio. However, if I enforce the desired values for PlotLabels and AspectRatio (as in plt1 below), Mathematica 12.2 is changing the output's PlotRange. Yet, if I enforce only one of PlotLabels or AspectRatio (as in plt2 or plt3 below), it returns the correct PlotRange. Is there a way to simultaneously specify all three correctly?
I've attached a minimal working example.
data = Table[{x, 1}, {x, -2., 2.}];
plt1 = ListPlot[
data
, PlotRange -> {{-2., 2.}, {0., Sqrt[2.]}}
, PlotLabels -> "PlotLabels and AspectRatio"
, AspectRatio -> .353553
]
plt2 =
ListPlot[
data
, PlotRange -> {{-2., 2.}, {0., Sqrt[2.]}}
, PlotLabels -> "PlotLabels"
]
plt3 =
ListPlot[
data
, PlotRange -> {{-2., 2.}, {0., Sqrt[2.]}}
, AspectRatio -> .353553
, PlotLabel -> "AspectRatio"
]
Thanks in advance!