2
$\begingroup$
data = {{-1.77815, -4.92143}, {-1.47712, -4.44227}, {-1.30103, -4.17258},
        {-1.17609, -3.97794}, {-1.07918, -3.84542}};

ListPlot[data, AspectRatio -> 1, Frame -> True]

enter image description here

Why is the AspectRatio for horizontal and vertical axis not equal?

$\endgroup$
4
  • $\begingroup$ thank you ... is a similar command available, so the the axes have 1:1 scaling, without specifying the plot range? $\endgroup$
    – mrz
    Mar 31, 2016 at 11:41
  • $\begingroup$ AspectRatio -> Full $\endgroup$
    – Jason B.
    Mar 31, 2016 at 11:46
  • $\begingroup$ it seems that only AspectRatio -> Automatic yields the 1:1 axes scaling, as Thomas answered. $\endgroup$
    – mrz
    Mar 31, 2016 at 11:50
  • $\begingroup$ To verify thatAspectRatio -> Automatic gives the intended ratio: (AspectRatio /. (ListPlot[data, Frame -> True, AspectRatio -> Automatic] // AbsoluteOptions[#, AspectRatio] & // Quiet)) == Subtract @@ MinMax[data[[All, 2]]]/Subtract @@ MinMax[data[[All, 1]]] evaluates to True $\endgroup$
    – Bob Hanlon
    Jun 1, 2016 at 13:42

2 Answers 2

4
$\begingroup$

Try the following:

ListPlot[data, AspectRatio -> Automatic, Frame -> True]

Mathematica graphics

$\endgroup$
2
  • $\begingroup$ Thank you ... it looks as I wanted ... in the documentation it is written: AspectRatio -> Automatic determines the ratio of height to width from the actual coordinate values in the plot. I would like to know what exactly is meant by that ... $\endgroup$
    – mrz
    Mar 31, 2016 at 11:59
  • $\begingroup$ I guess it means exactly what you want to achieve - that the aspect ratio of the plot corresponds to the aspect ratio of the actual coordinates. In other words, x- and y-coordinates are plotted at the same scale $\endgroup$
    – Thomas
    Mar 31, 2016 at 12:03
0
$\begingroup$

The solution from Thomas works also when when PlotRange is used:

ListPlot[data, AspectRatio -> Automatic, Frame -> True, PlotRange -> {{-3, 1}, {-6, 1}}]

enter image description here

$\endgroup$
2
  • $\begingroup$ Somebody's system isn't working correctly. For me this shows your original plot with a square area, which is what AspectRatio->1 should mean. $\endgroup$
    – N.J.Evans
    Jun 1, 2016 at 13:08
  • $\begingroup$ @N.J.Evans: sorry mistake: AspectRatio -> Automatic should be there ... $\endgroup$
    – mrz
    Jun 30, 2016 at 12:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.