对于一篇论文,我们希望在森林图中显示我们的敏感数据。为此,我使用了 R 的森林绘图包。对于情节,我采用了此处提供的代码:https://www.r-bloggers.com/forest-plot-with-horizontal-bands/。我现在遇到的问题是标签文本中的效果是居中对齐的。由于某些效果是负面的,因此文本看起来很轻飘飘。虽然我环顾四周,但我找不到左对齐文本的方法。
这是实际情节的代码。我认为这是一个小问题,但我得到了库存。 感谢您的任何帮助
forestplot(labeltext=tabletext, graph.pos=5,
mean=c(NA,NA,NA,NA,data$Group.difference),
lower=c(NA,NA,NA,NA,data$Lower), upper=c(NA,NA,NA,NA,data$Upper),
title="Sensitivity Analyses of gait speed 3 months after Stroke",
xlab="<---RELAX Better--- ---PHYS Better--->",
grid = TRUE,
hrzl_lines=list("5" = gpar(lwd=1, col="black"),
"9" = gpar(lwd=45, lineend="butt", columns=c(1:7), col="#99999922"),
"18" = gpar(lwd=45, lineend="butt", columns=c(1:7), col="#99999922"),
"26" = gpar(lwd=45, lineend="butt", columns=c(1:7), col="#99999922")),
txt_gp=fpTxtGp(label=gpar(cex=1.25),
ticks=gpar(cex=1.1),
xlab=gpar(cex = 1.2),
title=gpar(cex = 1.8)),
col=fpColors(box="black", lines="black", zero = "gray50"),
zero=0, cex=0.9, lineheight = "auto", boxsize=0.5, colgap=unit(6,"mm"),
lwd.ci=2, ci.vertices=TRUE, ci.vertices.height = 0.4)
只需包括:
align = c("l", "l", "l"), # Use "l", "c", or "r" for left, center, or right aligned