dabestr
dabestr copied to clipboard
using superscript in the names of groups in plot
Hi all, I need to change the groups names in a dabestr plot using super and subscript
from Asaia phM4 to AsaiaphM4
any suggestion?
Thank you very much
Massimo
Hi @TMax66 ,
This seems to be a very thorny problem!
Typically, to add custom labels, you would pass the superscript as an expression when you set up the x-scales with ggplot::scale_x_discrete
, for example.
However, dabestr builds each panel as a single ggplot object, and pre-determines the xtick labels.
You could try setting each element in the x-column in the original dataset as an expression (see here), but I have had no success with that.. yet.
The fastest way would be to edit the SVG output in a vector graphics software.
Hi @josesho,
thank you for the answer...
Yes i tried in many different way before asked here without success...
I will try with SVG, but i have so many plot to change ....
Another way is to use data in the list producted from dabest() function and make two separate plot , modify scales using ggplot::scale_x_discrete
and using patchwork to get the final plot....
thanks Massimo