Graphics Reference
In-Depth Information
Figure 8-10. Left: scatter plot with equal scaling of axes; right: with tick marks at specified posi-
tions
Discussion
The
marathon
data set contains runners' marathon and half-marathon times. In this case it might
be useful to force the x- and y-axes to have the same scaling.
It's also helpful to set the tick spacing to be the same, by setting
in
breaks
sp
+
coord_fixed()
+
scale_y_continuous(breaks
=
seq(
0
,
420
,
30
))
+
scale_x_continuous(breaks
=
seq(
0
,
420
,
30
))
If, instead of an equal ratio, you want some other fixed ratio between the axes, set the
ratio
parameter. With the
marathon
data, we might want the axis with half-marathon times stretched