diff --git a/communicate-plots.Rmd b/communicate-plots.Rmd index 5111e2c..405b075 100644 --- a/communicate-plots.Rmd +++ b/communicate-plots.Rmd @@ -109,9 +109,12 @@ That helps a bit, but if you look closely in the top-left hand corner, you'll no ```{r} ggplot(mpg, aes(displ, hwy)) + geom_point(aes(colour = class)) + + geom_point(size = 3, shape = 1, data = best_in_class) + ggrepel::geom_label_repel(aes(label = model), data = best_in_class) ``` +Note the other handy technique here: I added a second layer of large, hollow points to highligh the points that I've labelled. + You can sometimes use the same idea to replace the legend with labels placed directly on the plot. It's not wonderful for this plot, but it isn't too bad. (`theme(legend.position = "none")` turns the legend off --- we'll talk about it more shortly). ```{r}