[英]Change the color of a confidence interval band?
blandr
創建了一個 ggplot object,因此您可以使用ggplot_build
方法修改 colors。
library(blandr)
library(ggplot2)
x1 <- rnorm(100);x2 <- rnorm(100,mean = 1)
p <-
blandr.draw(x1, x2, ciShading = TRUE, ciDisplay=TRUE, plotter = "ggplot")
p_build <- ggplot_build(p)
#> Warning: Use of `plot.data$x.axis` is discouraged. Use `x.axis` instead.
#> Warning: Use of `plot.data$y.axis` is discouraged. Use `y.axis` instead.
p_build$data[[12]][["fill"]] <- "grey"
p_build$data[[13]][["fill"]] <- "steelblue"
p_build$data[[14]][["fill"]] <- "thistle"
grid::grid.draw(ggplot_gtable(p_build))
由代表 package (v2.0.0) 於 2021 年 6 月 11 日創建
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.