Dùng thuộc tính

Nhập môn trực quan hóa dữ liệu với ggplot2

Rick Scavetta

Founder, Scavetta Academy

Aesthetics? Thuộc tính!

ggplot(iris, aes(x = Sepal.Length, 
                 y = Sepal.Width)) + 
  geom_point(color = "red")
Kiểu Thuộc tính
Màu "red"

Đặt thuộc tính trong geom_*().

Thuộc tính màu được đặt là "red".

Nhập môn trực quan hóa dữ liệu với ggplot2

Aesthetics? Thuộc tính!

ggplot(iris, aes(x = Sepal.Length, 
                 y = Sepal.Width)) + 
  geom_point(size = 10)
Kiểu Thuộc tính
Kích thước 4

Nhập môn trực quan hóa dữ liệu với ggplot2

Aesthetics? Thuộc tính!

ggplot(iris, aes(x = Sepal.Length, 
                 y = Sepal.Width)) + 
  geom_point(shape = 4)
Kiểu Thuộc tính
Hình dạng 4

Nhập môn trực quan hóa dữ liệu với ggplot2

Cùng luyện tập!

Nhập môn trực quan hóa dữ liệu với ggplot2

Preparing Video For Download...