Modify legend when the aesthetics are mapped to variables. Specifically
Quite often the aesthetics are mapped to variables ggplot2 automatically creates legends wherever applicable. You may want to modify the appearance of legends. In this module, we will learn to modify the legends when the following aesthetics are mapped to categorical/continuous variables
library(ggplot2)
library(dplyr)
library(tidyr)
If you have mapped aesthetics to a continuous variable, you can modify the legend
ggplot(mtcars) +
geom_point(aes(disp, mpg, size = hp))