Highlight labelled points
This commit is contained in:
parent
344b5493a9
commit
8d20a69e65
|
@ -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}
|
||||
|
|
Loading…
Reference in New Issue