0

I'm trying to plot a forest plot but everytime I do so, there is an overlap of the text of the heterogeneity information with the x-axis of the forest plot. How can I edit my code so that this overlap doesn't happen (i.e., the x-axis is spaced away from the heterogeneity information so that the text is not overlapping?). I've included an image to clarify. In this picture, you can see that the 92% of the heterogeneity is overlapping with the "0" value of the x-axis (bottom left of the image)

Here is the code I've tried, but to no avail:

forest(mOE_Risk.Level, xlim = c(0.1, 1.00), layout = "RevMan5", comb.fixed = FALSE)

The library used is:

library(meta)
mishera
  • 11
  • 4
  • what library are you using? general answers will be to adjust the layout or change the size of the output `?Devices` – rawr Apr 26 '21 at 17:12
  • I am using library(meta). I was wondering as to what code you would suggest to adjust the layout or change the size of the output? – mishera Apr 26 '21 at 17:15
  • there are several `colgap` arguments, `Either a character string or a unit object specifying gap between columns printed on left and right side of forest plot.` – rawr Apr 26 '21 at 17:21
  • This is a great idea but what exactly do I enter after the "=" sign when I insert in the colgap argument into the forest() function? – mishera Apr 26 '21 at 22:23
  • Nevermind; I think this is working! I looked up "colgap.forest.left = "2cm"" and this seemed to have done the trick! Thank you @rawr ! – mishera Apr 26 '21 at 22:29

1 Answers1

0

Try suppressing the axis: ,xaxt="n". And adding on the next line a custom one that works for you: axis(1,at=c(2,4.5, 38),cex.axis=1.2 ).

Cris
  • 21
  • 3
  • Thank you for suggesting this! I tried this but I wasn't able to modify the axis in any shape or form by entering this code. I first got an error saying "plot.new has not been called yet". Then, what I did was first input "plot.new()", then the forest function that is shown in the OP, then your "xaxt="n"", and thereafter "axis(1,at=c(2,4.5, 38),cex.axis=1.2 )", but did not find any change to the plot whatsoever. I'm likely misunderstanding something here! – mishera Apr 26 '21 at 22:26
  • @mishera axis is a base graphics function, `meta::forest` is based on grid graphics, it won't work – rawr Apr 27 '21 at 02:52