Is your feature request related to a problem? Please describe.
The p values (e.g. p_flt) from the PlotSignature() function are added via ggplot2::annotate() and don't always fit the screen when making a small figure.
data(PhyloExpressionSetExample)
p <- PlotSignature(ExpressionSet = PhyloExpressionSetExample, permutations = 100)
p
Describe the solution you'd like
Perhaps the p-value can be passed as the subtitle for the plot. This will remove the issue of the text being cut off when making small figures. Here is an example implementation (without the preexisting p-value label).
p + ggplot2::labs(subtitle = ggplot2::ggplot_build(p)$data[[3]][["label"]])
# ggplot2::ggplot_build(p)$data[[3]][["label"]] extracts the annotation from the ggplot2 object.
However, this removes the flexibility users might have when they want to customise the subtitle themselves.
On the other hand, it also makes sense for the p-value to be presented in the subtitle. When the size is too big, the size of the subtitle can be changed.
p + ggplot2::labs(subtitle = ggplot2::ggplot_build(p)$data[[3]][["label"]]) +
ggplot2::theme(plot.subtitle = ggplot2::element_text(size=18, face="italic"))
Describe alternatives you've considered
Move the coordinate of the annotation. However, this can also lead to a similar issue (1. the label may not fit the plot & 2. it is unclear [to me] how annotations can be modified post-facto).
Is your feature request related to a problem? Please describe. The p values (e.g. p_flt) from the
PlotSignature()
function are added viaggplot2::annotate()
and don't always fit the screen when making a small figure.Describe the solution you'd like Perhaps the p-value can be passed as the subtitle for the plot. This will remove the issue of the text being cut off when making small figures. Here is an example implementation (without the preexisting p-value label).
However, this removes the flexibility users might have when they want to customise the subtitle themselves. On the other hand, it also makes sense for the p-value to be presented in the subtitle. When the size is too big, the size of the subtitle can be changed.
Whereas it is non-trivial to edit (or remove in the case above) annotations (
ggplot2::annotate("text", ...)
) post-facto. https://stackoverflow.com/questions/20083700/how-to-have-annotated-text-style-to-inherit-from-theme-set-options(Let me know if otherwise)
Describe alternatives you've considered Move the coordinate of the annotation. However, this can also lead to a similar issue (1. the label may not fit the plot & 2. it is unclear [to me] how annotations can be modified post-facto).
Additional context Lines implicated in https://github.com/drostlab/myTAI/blob/master/R/PlotSignature.R
https://github.com/drostlab/myTAI/blob/e8c12b12de4b6b5ce07aaa046ed199c6277e3e41/R/PlotSignature.R#L295-L302
https://github.com/drostlab/myTAI/blob/e8c12b12de4b6b5ce07aaa046ed199c6277e3e41/R/PlotSignature.R#L310-L317
https://github.com/drostlab/myTAI/blob/e8c12b12de4b6b5ce07aaa046ed199c6277e3e41/R/PlotSignature.R#L338-L345
etc.