Adding a table of values below the graph in ggplot2

前端 未结 1 714
被撕碎了的回忆
被撕碎了的回忆 2021-01-13 04:54

Sample data:

### Data
df <- data.frame(year = seq(as.Date(\"1998/1/1\"), as.Date(\"2012/1/1\"), \"years\"),
                 ton = sample(200:500, 15, rep         


        
相关标签:
1条回答
  • 2021-01-13 05:20
    tt <- ttheme_default(colhead=list(fg_params = list(parse=TRUE)),
                         base_size = 10,
                         padding = unit(c(2, 4), "mm"))
    tbl <- tableGrob(df1, rows=NULL, theme=tt)
    
    png("E:/temp/test.png", width = 1000, height = 1000)
    grid.arrange(plot1, plot2, tbl, 
                 nrow = 3, heights = c(2, 2, 0.5))
    dev.off()
    

    0 讨论(0)
提交回复
热议问题