'Set panel label size in R::multipanelfigure

I am creating a multi panel figure that includes a ComplexHeatmap object so I am using multi_panel_figure() instead of ggarrange().

I have tried to include an argument to set the labels manually as I do in ggarrange but it does not work.

ggarrange(...,
font.label = list(size = 14, color = "black", face = "bold", family = NULL))

Like this:

Figure2 = multi_panel_figure(width = 360, height = 180,
                             columns = 3, rows = 1,
                             font.label = list(size = 24))

Figure2 %<>% fill_panel(DE_HM, column = 1)
Figure2 %<>% fill_panel(DE_TM, column = 2:3)

save_multi_panel_figure(figure = Figure2,
                        filename = "Figure2.svg")

I am quite new using ggplot2 so I do not know very well how to control the text size proportions. In this case I would like to make the labels bigger as I need to make the figure large so other text in it can be read easily. Maybe I should generate my figure any other way?

Here is how the labels look like right now (panel B need to be large so text can be read in the treemap):

enter image description here



Solution 1:[1]

With trace(fill_panel, edit=T) change the function fill_panel() on line 124 from:

panel_label <- textGrob(label = label, x = 1, y = 0, just = label_just)

to:

panel_label <- text_grob(label = label, x = 1, y = 0, just = label_just, face = "bold", size = 14)

also use library(ggpubr) in order to make this work.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 pascal