Dear,
I would like to make the scale similar in all plots. Any idea how to do it?
Here is my code
a_filtered <- a %>%
filter(name == "norm_CntTs", !is.na(coding))
plot <- ggplot(a_filtered, aes(x = Condition, y = value, color = Condition)) +
geom_boxplot(width = 0.5, show.legend = FALSE) +
scale_y_log10() +
scale_size(range = c(0, 0.2))+
scale_color_manual(values = c("HRSV" = "#eb4a40", "HRSV_RBV" = "#045275")) +
facet_wrap(. ~ coding, ncol = 2) +
labs(title = "Ts", y = "Average Ts count") +
theme_bw() +
theme(text = element_text(size = 19, face="bold"),
plot.title = element_text(hjust = 0.5),
strip.text = element_text(face = "bold"))
p1 <- plot + stat_compare_means(method = "wilcox.test",comparisons = my_comparisons,size= 4.5, hjust= 0.09,vjust=-0.2, alternative = "two.sided",
paired = F, label = "p.value")
p1
a_filtered_tv <- a %>%
filter(name == "norm_CntTv", !is.na(coding))
plot <- ggplot(a_filtered_tv , aes(x = Condition, y = value, color = Condition)) +
geom_boxplot(width = 0.5, show.legend = FALSE) +
scale_y_log10() +
scale_size(range = c(0.01, 0.2))+
scale_color_manual(values = c("HRSV" = "#eb4a40", "HRSV_RBV" = "#045275")) +
facet_wrap(. ~ coding, ncol = 2) +
labs(title = "Tv", y = "Average Tv count") +
theme_bw() +
theme(text = element_text(size = 19, face="bold"),
plot.title = element_text(hjust = 0.5),
strip.text = element_text(face = "bold"))
p2 <-plot + stat_compare_means(method = "wilcox.test",comparisons = my_comparisons,size= 4.5, hjust= 0.09,vjust=-0.2, alternative = "two.sided",
paired = F, label = "p.value")
p1+p2 +
facet_wrap(. ~ coding, ncol = 2)
Thanks in advance
Cross-posted https://stackoverflow.com/q/78550579/680068