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

  • 關於本站
  • 免責聲明