logo
  • 教程列表
  • SO官方文档
  • 绘制数据子集
    • 使用 xlim ylim
    • 分类变量的内联子集
  1. StackOverflow 文档
  2. ggplot2 教程
  3. 绘制数据子集
  4. 使用 xlim ylim

使用 xlim ylim

Created: November-22, 2018

> library(ggplot2)
> ggplot(iris,aes(Sepal.Width)) + geom_density() + xlim(1,3.5)

使用 xlim 或 ylim 不会切割图,ggplot 在调用 stat 函数之前对数据进行子集(在本例中为 stat_density)。你可以在警告消息中看到它。

Warning message:
Removed 19 rows containing non-finite values (stat_density).
  • 分类变量的内联子集
  • 绘制数据子集

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明