One option to fix your issue would be to switch to the patchwork
package to glue your plots together and which allows to add a title, caption, ... the same way as we would do for a single ggplot
. Second, to fix your issue with the superscript you could create your caption as a ?plotmath
expression.
Using a minimal reproducible example based on mtcars
:
library(ggplot2)
library(patchwork)
HR1Plot <- HR3Plot <- HR12Plot <- HR24Plot <- ggplot(mtcars, aes(hp, mpg)) +
geom_point()
caption <- expression(
Long ~ arbitrary ~ caption ~ with ~
word^{superscripted} ~ "in" ~ the ~ middle.
)
list(HR1Plot, HR3Plot, HR12Plot, HR24Plot) |>
wrap_plots(ncol = 2) &
plot_annotation(tag_levels = "A", caption = caption) &
theme(
plot.caption = element_text(hjust = 0),
plot.tag = element_text(face = "bold")
)

EDIT First, wrap_plots
requires the patchwork
package which you have to install and attach as I do. Second, plotmath
could be a bit tricky, i.e. you have to wrap the ,
in quotes, i.e. use ","
. Also besides the ~
separattor which adds a space there is also a *
separator.
library(ggplot2)
library(patchwork)
HR1Plot <- HR3Plot <- HR12Plot <- HR24Plot <- ggplot(mtcars, aes(hp, mpg)) +
geom_point()
caption <- expression(
th~or~without~forskolin~on~S16~cell~viability.~
Using~the~CyQUANT^TM~MTT~Cell~Viability~Assay~Kit~(Thermo~Fisher)*","
~the~immortalized~rat~S16~cell~line~(ATCC~CRL-2941)~was~treated~with~0*","~0.1,
)
list(HR1Plot, HR3Plot, HR12Plot, HR24Plot) |>
wrap_plots(ncol = 2) &
plot_annotation(tag_levels = "A", caption = caption) &
theme(
plot.caption = element_text(hjust = 0),
plot.tag = element_text(face = "bold")
)

However, while plotmath
is the way to go for math expression, in your case I would suggest to switch to e.g. ggtext
to add your superscript text. The latter allows to add use some basic HTML, CSS or markdown to format text, e.g. you could add a superscript via a <sup>
tag. Additionally, as you caption is quite long ggtext
makes it easy to split your caption over mutliple lines (which plotmath
does not) and via ggtext::elment_textbox_simple
you could achieve that more or less automatically:
library(ggtext)
caption <- "
th or without forskolin on S16 cell viability.
Using the CyQUANT<sup>TM</sup> MTT Cell Viability Assay Kit (Thermo Fisher)
the immortalized rat S16 cell line (ATCC CRL-2941) was treated with 0, 0.1,
"
list(HR1Plot, HR3Plot, HR12Plot, HR24Plot) |>
wrap_plots(ncol = 2) &
plot_annotation(tag_levels = "A", caption = caption) &
theme(
plot.caption = ggtext::element_textbox_simple(hjust = 0),
plot.tag = element_text(face = "bold")
)
