ggplot2学习笔记

2018-11-12  本文已影响0人  阿牛_71f9

Summary

Every ggplot2 plot has three key components:

  1. data
  2. aesthetic mappings
  3. geom function

举例:

ggplot(mpg, aes(x = displ, y = hwy)) + geom_point()

可以省略掉xy,不影响结果

ggplot(mpg, aes(displ, hwy)) + geom_point()

Aesthetic Attributes

举例:

ggplot(mpg, aes(displ, cty, colour = class)) + geom_point()
上一篇 下一篇

猜你喜欢

热点阅读