dabestr icon indicating copy to clipboard operation
dabestr copied to clipboard

using superscript in the names of groups in plot

Open TMax66 opened this issue 4 years ago • 2 comments

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 plot

TMax66 avatar May 06 '20 18:05 TMax66

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.

josesho avatar May 07 '20 04:05 josesho

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

TMax66 avatar May 07 '20 08:05 TMax66