Using attributes

Introduction to Data Visualization with ggplot2

Rick Scavetta

Founder, Scavetta Academy

Aesthetics? Attributes!

ggplot(iris, aes(x = Sepal.Length, 
                 y = Sepal.Width)) + 
  geom_point(color = "red")
Type Property
Color "red"

Set attributes in geom_*().

The color attribute is set to "red".

Introduction to Data Visualization with ggplot2

Aesthetics? Attributes!

ggplot(iris, aes(x = Sepal.Length, 
                 y = Sepal.Width)) + 
  geom_point(size = 10)
Type Property
Size 4

Introduction to Data Visualization with ggplot2

Aesthetics? Attributes!

ggplot(iris, aes(x = Sepal.Length, 
                 y = Sepal.Width)) + 
  geom_point(shape = 4)
Type Property
Shape 4

Introduction to Data Visualization with ggplot2

Let's practice!

Introduction to Data Visualization with ggplot2

Preparing Video For Download...