I would like to find an easy solution to numbering subfigures as this is a very standard exercise of my work. I could do this by arranging the plots and automatically adding number via e.g. egg::ggarrange()
. However, this gets complicated and especially ugly if I have a ggplot that is already split into facets via facet_grid()
and with a long strip text. I already asked a similar question here.
In publications I would usually want to have subfigures with a label at the top left or right corner like 1, 2, 3...
or A, B, C,...
and subfigure text label describing the facet centered on top. Both, the label and the text should be independent from each other. Looking at the solution of @stefan in my above mentioned question, the labels and text are obviously not independent from each other and the labels are not left-aligned.
I wonder, is there maybe a function that puts labels like 1, 2, 3...
or A, B, C,...
left-aligned on top of the top-right corner of the facet independent of the (centered) strip text itself? That would be awesome and would save me a lot of hassle.
I could obviously just use a label like "<b>1</b> Text label"
and left align it. But this looks really ugly if I have a very long text. What I want to achieve is rather a numeric label on the left and a text label spanning two lines.
An acceptable solution would be to split the strip text into two columns that are independent from each other. This way I could put a number left-aligned and centered a text label over two lines.