ggplot(iris, aes(Species, Sepal.Width)) +
geom_boxplot(aes(fill = Species)) +
guides(x = guide_axis_manual(
label_colour = scales::hue_pal()(3),
label_face = c("bold", "italic", "plain"),
labels = toupper
))
# Using the manual axis to annotate some specific point
ggplot(pressure, aes(temperature, pressure)) +
geom_point() +
geom_hline(yintercept = 300, linetype = 2, colour = "blue") +
guides(y.sec = guide_axis_manual(breaks = 300, labels = "some\nthreshold",
label_colour = "blue"))
Run the code above in your browser using DataLab