patchwork icon indicating copy to clipboard operation
patchwork copied to clipboard

Provide a generic for plots to generate patchwork-compliant tables

Open thomasp85 opened this issue 5 years ago • 3 comments

thomasp85 avatar Jun 17 '20 06:06 thomasp85

FYI: it doesn't seem possible to put a gridExtra::tableGrob(...) as the first element in the list of plots?

p1 <- ggplot(mtcars) + 
  geom_point(aes(mpg, disp)) + 
  ggtitle('Plot 1')
  
gridExtra::tableGrob(mtcars[1:10, c('mpg', 'disp')]) + p1

baderstine avatar Dec 17 '21 23:12 baderstine

@baderstine thanks! this is actually a life saver :)

liutiming avatar Jul 19 '22 09:07 liutiming

no, you generally have to wrap elements in wrap_elements() if they appear as the first due to how R's operator dispatch works

thomasp85 avatar Aug 08 '23 11:08 thomasp85