I have tried
h1 <- grid.grabExpr(draw(Heatmap(as.matrix(df_1[2:1692]), col = rev(rainbow(10)), name = "C1", cluster_columns = TRUE, cluster_rows = FALSE, show_column_names = FALSE, show_column_dend = FALSE, row_title = "G", column_title = "C")))
h2 <- grid.grabExpr(draw(Heatmap(as.matrix(df_2[2:2269]), col = rev(rainbow(10)), name = "C2", cluster_columns = TRUE, cluster_rows = FALSE, show_column_names = FALSE, show_column_dend = FALSE, row_title = "G", column_title = "C", use_raster = FALSE)))
h3 <- draw(Heatmap(as.matrix(df_3[2:1384]), col = rev(rainbow(10)), name = "C3", cluster_columns = TRUE, cluster_rows = FALSE, show_column_names = FALSE, show_column_dend = FALSE, row_title = "G", column_title = "C"))
plot_grid(h1, plot_grid(h2, h3))
But the error I get here is : Error in UseMethod("depth") : no applicable method for 'depth' applied to an object of class "NULL"
There's no direct way of combine ComplexHeatmap plots together if they are different sizes, I am guessing? Whats the best of making a plot together in a pdf?
I tried your script with some random data, and it seems to work fine for me. I think as long as you also extract grob in h3 it works
I personally like the patchwork package to compose my plots. Here's an example of combining multiple ComplexHeatmap of different sizes
Patchwork also allow assign widths, height, and do some more complex plot assembly, so it's worth checking out their tutorials.