Modify X and Y axis
In this module, we will learn how to modify the X and Y axis using the following functions:
scale_x_continuous()
scale_y_continuous()
scale_x_discrete()
scale_y_discrete()
library(ggplot2)
library(dplyr)
library(tidyr)
scale_x_continuous()
and scale_y_continuous()
take the following arguments:
ggplot(mtcars) +
geom_point(aes(disp, mpg))
ggplot(mtcars) +
geom_point(aes(disp, mpg)) +
scale_x_continuous(name = "Displacement")