Open jack-davison opened 4 weeks ago
R graphics doesn't really support markdown or html formatting out of the box, so I'm afraid you're hitting the limitations of the graphics system. You can swap out the text generating function, but I think there currently is no easy way to forward this from within {patchwork}.
gt <- data.frame(x = "ug m<sup>-3</sup>") |> gt::gt()
plot(gt::as_gtable(gt, text_grob = gridtext::richtext_grob))
Created on 2024-10-15 with reprex v2.1.1
Thanks - that makes sense to me!
plot(gt::as_gtable(gt, text_grob = gridtext::richtext_grob))
This actually does the job for my use-case as I don't necessarily need the other nice patchwork things (e.g., table header alignment with "space" etc.), just to stick a small table to a plot.
Happy to mark as closed if this is an impossible/unlikely to be achieved thing for patchwork.
gt version 0.11.0
patchwork version 1.3.0
reprex:
I wasn't sure if a) this was a known issue and b) whether there's a workaround to get subscripts/superscripts/etc. in a "wrapped table" in a patchwork assembly?
Cheers!
(I don't know if I should cc @teunbrand as I know you worked on gt grob outputs!)