个性化绘图的置信区间条的颜色.effects()R



早上好,我说的是情节。R包的影响;效果";,https://cran.r-project.org/web/packages/effects/effects.pdf

我想个性化plot.effects((.的置信区间条的颜色

confint=list(style="bars",color="black"(看起来不起作用,置信区间的颜色参数取自线条的颜色。

这是我使用的代码:

#remove all the axis
trellis.par.set(list(axis.line = list(col = c(0))))
my.theme <- list(
axis.components = list(top = list(tck = 0, pad1 = 0, pad2 = 0),
right = list(tck = 0,pad1 = 0, pad2 = 0)))
trellis.par.set(theme = my.theme)
#add only bottom and left axis  
myAxisFun <- function(side, line.col, ...) {
if (side == "left") {
grid.lines(x = c(0, 0), y = c(0, 1), default.units = "npc")
} else if (side == "bottom") {
grid.lines(x = c(0, 1), y = c(0, 0), default.units = "npc")
}
axis.default(side = side, line.col = 1, ...)  
}

plot(A2[1],main="Interaction between Subtopic and Condition",ylab="Response Accuracy",
lines=list(multiline=T,col=c( "#CC6677","#332288", "#88CCEE"),lty=1:3,lwd=c(2,2,2)),
confint=list(style="bars",color="black"), #add the confidence interval
#band.colors=c("black","black","black"), 
#residuals.color="black",
#confint.col="black",
axis = myAxisFun,
symbols=list(pch=c(NA, NA, NA, 1, 1, 1, 1))) #remove simbols

在函数中注释了我试图设置的其他参数,但没有任何结果。

也许解决方案是一个个性化的功能,就像我习惯的轴一样?(参考在R中的双Y刻度图中隐藏顶部x轴(

蓝色箭头指向其中一条带子,我会改变它的颜色。

上一个代码的结果

我希望这个请求足够明确,感谢所有能提供帮助的人。

目前,我找到了一个次优解决方案,该解决方案包括使用GIMP修改PDF打印图中条形图的颜色。该程序允许您在不丢失PDF质量的图像的情况下,手动调整您需要的细节。

最新更新