Closed tdlan80 closed 1 year ago
Can you add a feature/
arg
to modify the secondary Y axes? The statistical test used for multiple pairwise comparisons are now displayed as a title of the secondary Y axis. can you provide an option to either remove this secondary axes title entirely from the plot? If I setresults.subtitle = F
, I will lose all test results, not just the pwc test type.
You can pass additional arguments to {ggplot2}
to customize the plot further to your liking:
library(ggstatsplot)
ggbetweenstats(
mtcars, cyl, wt,
ggplot.component = list(
ggplot2::scale_y_continuous(sec.axis = ggplot2::dup_axis(name = "My custom test"))
)
)
#> Scale for y is already present.
#> Adding another scale for y, which will replace the existing scale.
Created on 2023-06-08 with reprex v2.0.2
Of course, you can also use the same approach to remove that label completely by setting name = ""
.
And, can the name of this pairwise comparison test be displayed as the where
bf.message
or thecaption
appears?
No, because this space is already quite congested with the existing details, and adding more information here would just make it even more difficult to decode. The behaviour you are describing used to be the default behaviour but I changed to the current one precisely for the reason I mentioned.
Thanks, I should have looked into ggplot.component
before. I understand that bf.message
already fill-up the caption
space.
And, yes, ggplot2::scale_y_continuous(sec.axis = ggplot2::dup_axis(name = " ", labels = NULL, breaks = NULL))
does work to remove the title of the duplicated axis. But, this might give off annoying warnings.
instead, this might be a better option:
ggplot.component = list( theme(axis.title.y.right = element_blank(), axis.text.y.right = element_blank(), axis.ticks.y.right = element_blank())
Can you add a feature/
arg
to modify the secondary Y axes? The statistical test used for multiple pairwise comparisons are now displayed as a title of the secondary Y axis. can you provide an option to either remove this secondary axes title entirely from the plot? If I setresults.subtitle = F
, I will lose all test results, not just the pwc test type.And, can the name of this pairwise comparison test be displayed as the
bf.message
or thecaption
appears?