parent
5caf82d215
commit
0cadd594e1
|
@ -111,7 +111,7 @@ ggplot(mpg, aes(displ, hwy)) +
|
|||
geom_label(aes(label = model), data = best_in_class, nudge_y = 2, alpha = 0.5)
|
||||
```
|
||||
|
||||
That helps a bit, but if you look closely in the top-left hand corner, you'll notice that there are two labels practically on top of each other. This happens because the highway mileage and displacement for the best cars in the compact and subcompact categories are exactly the same.There's no way that we can fix these by applying the same transformation for every label. Instead, we can use the __ggrepel__ package by Kamil Slowikowski. This useful package will automatically adjust labels so that they don't overlap:
|
||||
That helps a bit, but if you look closely in the top-left hand corner, you'll notice that there are two labels practically on top of each other. This happens because the highway mileage and displacement for the best cars in the compact and subcompact categories are exactly the same. There's no way that we can fix these by applying the same transformation for every label. Instead, we can use the __ggrepel__ package by Kamil Slowikowski. This useful package will automatically adjust labels so that they don't overlap:
|
||||
|
||||
```{r}
|
||||
ggplot(mpg, aes(displ, hwy)) +
|
||||
|
|
Loading…
Reference in New Issue