【问题标题】:box plot with whiskers with mean value line带有均值线的晶须的箱线图
【发布时间】:2018-08-27 01:14:16
【问题描述】:

我正在尝试创建带有如下平均值线的胡须的箱线图。[两个不同模型的平均现金流(166 个值)与真实分布平均值(1 个值)进行比较]

如何在r中创建这样的?

【问题讨论】:

  • 请提供您当前的代码和图表
  • boxplot(y ~ x, data=your_dataframe_name) 将帮助您开始
  • 箱线图(mean.DCL,mean.ODP,mean.Mack,mean.res,col =(c("gold","green","blue","yellow")),main ="平均储量直方图",xlab= "储量",names=c("DCL","ODP","Mack","True")) boxplot(sd.DCL.Procerr,sd.ODP.Procerr,sd .Mack.Procerr,sd.res,col =(c("gold","green","blue","yellow")),main= "SD 储备直方图",xlab= "Reserves",names=c ("DCL","ODP","Mack","True")) 其中 mean.DCL,mean.ODP,mean.Mack 为 [1,200],mean.res 为 [1]。
  • 嗨,ANG,这不是重复的。我希望真均值线从 x 轴的零到轴的末端,穿过图中的所有箱形图。您在重复项下提到的链接中也没有提供通用解决方案。请有人帮忙。

标签: r boxplot


【解决方案1】:

以下几行解决了我的问题: boxplot(mean.DCL,mean.ODP,mean.Mack,col =(c("gold","green","blue")),main="Histogram of Process Mean Reserves",xlab="Reserves",names =c("DCL","ODP","Mack"),ylim = c(2200000, 3500000),by = 2000000) 线(x = c(0:S), y = rep(mean.res,S+1), col="red",lty = 2, lwd = 2)

the mean is the dotted line through the other values of all models considered

【讨论】:

    猜你喜欢
    • 2018-08-13
    • 2014-06-24
    • 2021-06-23
    • 2020-05-27
    • 2021-07-01
    • 2017-10-13
    • 1970-01-01
    • 2019-03-19
    • 1970-01-01
    相关资源
    最近更新 更多