Skip to content

Instantly share code, notes, and snippets.

@baptiste
Created September 23, 2018 20:30
Show Gist options
  • Save baptiste/3245ea258486b81cfd1bcf1532b82775 to your computer and use it in GitHub Desktop.
Save baptiste/3245ea258486b81cfd1bcf1532b82775 to your computer and use it in GitHub Desktop.
library(gridExtra)
library(grid)
library(gtable)
d <- iris[1:2,1:3]
g <- tableGrob(d, rows=NULL)
grid.newpage()
grid.draw(g)
ncol(g) == 3
grid.newpage()
gtable_show_layout(g)
t <- ttheme_default()
t$core$fg_params$hjust = rep(c(0,0.5,1), each=nrow(g)-1)
t$core$fg_params$x = rep(c(0,0.5,1), each=nrow(g)-1)
g2 <- tableGrob(d, rows=NULL, theme = t)
grid.newpage()
grid.draw(g2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment