Clear background in a text grob below a complex figure

In creating a figure in a Supplement to a ms that I am submitting to a journal, I am instructed to "include the figure legend within the final graphic." I thought that Joels had solved this problem for me, but I am having the same problem again. The text grob that I add below the graphic is formatted with the default figure fill -- white grid lines on a light blue background, despite setting the default theme to theme_bw. Fig1Supp is a complex graphic composed of the plot and an at-risk table below it. Note that the plot itself is already formatted with theme_bw.The Figure legend is added by the code below. I need to get rid of this background. Any suggestions as to how to accomplish this? Thanks in advance for any suggestions.
Larry Hunsicker

Figure1Supp.pdf (12.0 KB)

library(grid)
library(gridExtra)
FigS1LegText <- "Figure S1:  Long term death censored functional graft survival of transplants with en-bloc vs.\nsplit donor kidneys in five highest donor weight categories.  Outcomes for split kidneys from\ndonors < 10 kg were inferior to those from expanded donor kidneys.  Only 2/11 failures of \nen-bloc kidneys from donors 25-29.9 kg precludes meaningful evaluation of this cohort."
Fig1SuppTxtGrob <- textGrob(FigS1LegText, 
      x = 0.01, just = "left", gp = gpar(fontsize = 12))
FigS1FinalGrob <-  arrangeGrob(Fig1Supp, Fig1SuppTxtGrob,
      nrow = 2, heights = unit(c(2, .3),c("null", "null")))
windows(width = 7.5)
plot(FigS1FinalGrob)

FinalFig.pdf (15.1 KB)

OK. I figured it out. In the last line of the code above, change

plot(FigS1FinalGrob)
to
grid.draw(FigS1FinalGrob)

Now the textGrob is plotted without the blue background.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.