Graphics Reference
In-Depth Information
Figure 5-31. Left: a scatter plot with vjust=0; right: with a little extra added to y
It often makes sense to right- or left-justify the labels relative to the points. To left-justify, set
labels will still slightly overlap with the points. This time, though, it's not a good idea to try to
fix it by increasing or decreasing
hjust
. Doing so will shift the labels a distance proportional to
the length of the label, making longer labels move further than shorter ones. It's better to just set
sp
+
geom_text(aes(label
=
Name), size
=
4
, hjust
=
0
)
sp
+
geom_text(aes(x
=
healthexp
+
100
, label
=
Name), size
=
4
, hjust
=
0
)