When I set the function, geom_smooth(..., se = TURE)
, the confidence interval is gray, but I want to set some other color.
Looks like it is a parameter that can not set color in geom_smooth. Should I create a new geom? or are there some ggplot2 extensions can be used? Thank you
By default, geom_smooth() uses 95% confidence bands but you can use the level argument to specify a different confidence level.
se Display confidence interval around smooth (TRUE by default, see level to control.)
stat_smooth() provides the following variables, some of which depend on the orientation: y or x. predicted value. ymin or xmin. lower pointwise confidence interval around the mean.
The grey area [SE=TRUE] would be a zone that covers 95% confidence level [that the values will be within that area]. https://ggplot2.tidyverse.org/reference/geom_smooth.html [Level=95% by default, can be increased to 99%]. Switching it to SE=FALSE hides it.
Since you did not provide example data
ggplot(
iris,
aes(
x = Sepal.Length,
y = Sepal.Width
)
) +
geom_point() +
geom_smooth(fill = "red")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With