【问题标题】:Left align text in forestplot() from forestplot packageForestplot 包中的 forestplot() 中的文本左对齐
【发布时间】:2018-05-16 13:47:04
【问题描述】:

对于一篇论文,我们希望在森林图中显示我们的敏感数据。为此,我使用了 R 中的 forestplot-package。对于情节,我采用了此处提供的代码:https://www.r-bloggers.com/forest-plot-with-horizontal-bands/。我现在遇到的问题是我的 labeltext 中的效果是居中对齐的。由于某些效果是负面的,因此文本看起来很飘逸。虽然我环顾四周,但没有找到左对齐文本的方法。

这是实际情节的代码。我认为这是一个小问题,但我有库存。 感谢您的帮助

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)

【问题讨论】:

    标签: r forestplot


    【解决方案1】:

    只需包括:

     align = c("l", "l", "l"), # Use "l", "c", or "r" for left, center, or right aligned
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-17
      • 1970-01-01
      • 2015-02-12
      • 2015-04-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多