To understand what is going on lets examine your initial plot. We assign it to the variable g
:
g = Show[
Plot[1/2 x + 1/2, {x, -6, 7}],
ListPlot[{{4, -2.5}, {2, 1.5}}, Joined -> True, PlotMarkers -> Automatic]
]
g // ImageDimensions
{360, 224}
The figure's aspect ratio is therefore:
#2/#1 & @@ ImageDimensions[g] // N
0.6222222222
which happens to be close to $\frac{2}{\sqrt{5}+1}\approx 0.6180339887$ or the reciprocal of the golden ratio. This ratio is widely considered as being aesthetically pleasing and is therefore the default aspect ratio for Mathematica's Plot
function:
Options[Plot, AspectRatio]
{AspectRatio -> 1/GoldenRatio}
With AspectRatio->Automatic
Mathematica sets the aspect ratio to the ratio of the plot ranges in x and y directions:
h = Show[
Plot[1/2 x + 1/2, {x, -6, 7}],
ListPlot[{{4, -2.5}, {2, 1.5}}, Joined -> True, PlotMarkers -> Automatic],
AspectRatio -> Automatic
];
#2/#1 & @@ ImageDimensions[h] // N
0.5083333333
#2/#1 & @@ (Subtract @@@ PlotRange[h])
0.4999999796
(small difference caused by the discrete pixel size).
This choice causes the the plot space to be isotropic which is needed for a correct display of angles.
h
Note that the default aspect ratio for Graphics
is:
Options[Graphics, AspectRatio]
{AspectRatio -> Automatic}
This makes sense as in most drawings we want an isotropic space.
AspectRatio
. $\endgroup$AspectRatio
, but it's not what I'm looking for. AspectRatio simply stretches the graphics but I'm fine with it's current size. $\endgroup$AspectRatio -> Automatic
? $\endgroup$Automatic
does indeed work! $\endgroup$