0

Hello I used this code in order to get a ggplot figure :

ggplot(mod_mat_constraint, aes(x=Categorie, y=label))  + scale_fill_manual(values = c("#86d65e","#404040","#86d65e","#40c5e8","#e84a4a","#86d65e","#404040","#e2e2e2"), breaks=label_text) +
  theme_tree2() + geom_tile(aes(fill = Value), colour = "black") + facet_wrap(~ facet)  +
  scale_y_discrete(limits=rev(list_tax_order))+
  coord_cartesian(clip='off') +
  annotation_custom(valigned,xmin = -Inf, xmax = Inf, ymin = -Inf, ymax = Inf)+
  theme(legend.position="none",plot.margin = unit(c(0, 12, 0, 0), "cm"))

so it just display a heatmap with a table next to it. In order to add the the table I use then : annotation_custom(valigned,xmin = -Inf, xmax = Inf, ymin = -Inf, ymax = Inf)

so I can move the table everywhere I want but I do not know how I can deal with the size of the df ?

I previously create the table with :

g1<-tableGrob(Resricted_df_heatmap3[1],rows = NULL)
g2<-tableGrob(Resricted_df_heatmap3[2],rows = NULL)


valigned <- gtable_combine(g1,g2, along=2)
valigned<- gtable_add_grob(valigned ,
                     grobs = rectGrob(gp = gpar(fill = NA, lwd = 3)),
                     t = 1, b = nrow(valigned), l = 1, r = ncol(valigned))
chippycentra
  • 3,396
  • 1
  • 6
  • 24
  • 2
    What exactly is your issue? Can you rephrase or elaborate on your question? What errors are you receiving, etc.? – Dylan_Gomes May 30 '20 at 23:14
  • I simply added a table called `valigned`into my plot using the ggplot `annotation_custom` but I would need to increase the size of the table, I would expect to see a size option for that but it does not seem to exists. – chippycentra May 31 '20 at 06:32
  • A simple self contained example would help. [This post](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610#5963610) is relevant. – Limey Jun 01 '20 at 07:32

0 Answers0