gforge / forestplot

Advanced forest plots in R using grid graphics
43 stars 15 forks source link

Squashed plot #20

Closed kishorekukendra closed 6 years ago

kishorekukendra commented 6 years ago

Hi, I am trying to use the forestplot function for data from a network meta, analysis. When I create the plot it seems to have squashed the x-axis and confidence intervals as such.

image

it seems to only have happened after I added my P-Value column as without it it appears like this

image

I have tried playing around viewport settings to no avail

Here is the code I have for the plot including P-Values

net5_forestplot <- forestplot(mean = as.numeric(graphtable5[,4]),
                              upper = as.numeric(graphtable5[,6]),
                              lower = as.numeric(graphtable5[,5]),
                              labeltext = graphtable5[,1:3],
                              is.summary = c(T,T,rep(F,3),T,rep(F,3),T,rep(F,3),T,rep(F,3)),
                              hrzl_lines = list("2" = gpar(lwd=1, columns=1:3, col = "#000044"), 
                                                "3" = gpar(lwd=1, columns=1:3, col = "#000044"),
                                                "6" = gpar(lwd=1, columns=1:3, col = "#000044"),
                                                "7" = gpar(lwd=1, columns=1:3, col = "#000044"),
                                                "10" = gpar(lwd=1, columns=1:3, col = "#000044"),
                                                "11" = gpar(lwd=1, columns=1:3, col = "#000044"),
                                                "14" = gpar(lwd=1, columns=1:3, col = "#000044"),
                                                "15" = gpar(lwd=1, columns=1:3, col = "#000044")),
                              txt_gp=fpTxtGp(label=gpar(cex=1.1),
                                             ticks=gpar(cex=1.1),
                                             xlab=gpar(cex = 1.2),
                                             title=gpar(cex = 1.2)),
                            col=fpColors(box="royalblue", lines="darkblue", hrz_lines = "#444444", zero = "gray50"),
                              cex=0.9, lineheight = "auto", boxsize=0.5, colgap=unit(6,"mm"),
                              lwd.ci=2, ci.vertices=TRUE, ci.vertices.height = 0.4,
                              xlab = "<-- Favours Comparator   Favours Treatment --->",
                              title = expression(paste("Procedure Duration, 14 Trials, ", italic("I"^"2"), "= 91%")))

I am wondering if you may be able to help me? I'm sorry if it's a stupid question and there is an easy solution.

gforge commented 6 years ago

This seems like a question for stack overflow and not a bug