# Make Units Comparable on Axes of Two Plots

I have two graphs and I want to have the ratio of the units on the horizontal and vertical axes be the same. I do not want to use AspectRatio->Automatic because the vertical dimension would be too small. Here is some sample code:

egl = {Line[{
{0, .1}, {2, .3}}],
Line[{
{1.5, -.23}, {1.5, .7}}]};
g1 = Graphics[
egl,
Axes -> True,
AspectRatio -> .5,
PlotRange -> {{0, 2}, {0, .25}}]
g2 = Graphics[
egl,
Axes -> True,
AspectRatio -> 1.5]


You have to define PlotRange as well. In your first example you made at this point a mistake.

g1 = Graphics[egl, Axes -> True, AspectRatio -> 0.25/2, PlotRange -> {{0, 2}, {0, .25}}]


More general:

pRange = {{0, 2}, {0, .25}}
g1e = Graphics[egl, Axes -> True, AspectRatio -> 1/Divide @@ Flatten[Differences /@ pRange], PlotRange -> pRange]


The second example should be like that:

g2 = Graphics[egl, Axes -> True, PlotRange -> {{0, 2}, {-1, 1}}, AspectRatio -> 1] When you use AspectRatio -> 1 then the intervalls have to be equal. Means:

Differences@{0,2} == Differences@{-1,1}
(* True *)


Why do you use Show?

• Many thanks, I accepted the answer. I use show because I have been using Mathematica since version 2.0. I'll try to drop it. Oct 27, 2016 at 10:43