Agenda


Explore aesthetics such as

  • color
  • shape
  • size
  • fill
  • alpha
  • width

Intro


In this module, we will focus on the aesthetics i.e. color, shape, size, alpha, line type, line width etc. We can map these to variables or specify values for them. If we want to map the above to variables, we have to specify them within the aes() function. We will look at both methods.

Libraries


library(ggplot2)
library(dplyr)
library(tidyr)

Map Color to Variable


ggplot(mtcars, aes(x = disp, y = mpg, color = factor(cyl))) +
  geom_point()