You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After rotating boxplot x-axis labels 45 degrees, as suggested by @dunnpa, some right side labels are truncated by default right margin. To include all x-axis labels in the plot, the right margin is set with the following procedure. However, this procedure needs to be optimized for the following two purposes:
Guarantee that all x-axis labels are included and not truncated.
Guarantee that right margin always extend the rightmost label by 5.5 points, which is the default ggplot2 margin.
# increase right margin by the width of the last x label * 0.71
plot_margin[2] <-grid::unit(
x=0.8, units="strwidth", data=rightmost_x_label)
Example boxplot with truncated x-axis labels:
library(ggplot2)
data(diamonds)
diamonds$cut<- paste("Very very very long x-axis labels like our boxplot",as.character(diamonds$cut))
qplot(cut,carat,data=diamonds,geom="boxplot") +
theme(axis.text.x= element_text(angle=-45, vjust=1, hjust=0))
The text was updated successfully, but these errors were encountered:
After rotating boxplot x-axis labels 45 degrees, as suggested by @dunnpa, some right side labels are truncated by default right margin. To include all x-axis labels in the plot, the right margin is set with the following procedure. However, this procedure needs to be optimized for the following two purposes:
OpenPedCan-api/src/get_gene_tpm_boxplot.R
Lines 75 to 87 in b265d7b
Example boxplot with truncated x-axis labels:
The text was updated successfully, but these errors were encountered: