美文网首页
ggplot2学习笔记

ggplot2学习笔记

作者: 阿牛_71f9 | 来源:发表于2018-11-12 21:16 被阅读0次

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()

相关文章

网友评论

      本文标题:ggplot2学习笔记

      本文链接:https://www.haomeiwen.com/subject/vhhhfqtx.html