如何在ggplot2中设置geom_smooth的se(置信区间)的颜色? [英] How to set the color of se(confidence interval) of geom_smooth in ggplot2?

查看:326
本文介绍了如何在ggplot2中设置geom_smooth的se(置信区间)的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我设置功能 geom_smooth(...,se = TURE)时,置信区间为灰色,但是我想设置其他颜色.

When I set the function, geom_smooth(..., se = TURE), the confidence interval is gray, but I want to set some other color.

它看起来像是无法在geom_smooth中设置颜色的参数.我应该创建一个新的几何图形吗?还是可以使用某些ggplot2扩展名?谢谢

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

推荐答案

由于您未提供示例数据

ggplot(
    iris, 
    aes(
        x = Sepal.Length, 
        y = Sepal.Width
    )
) + 
    geom_point() + 
    geom_smooth(fill = "red")

这篇关于如何在ggplot2中设置geom_smooth的se(置信区间)的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆