How to label median/lower quartile/upper quartile in Boxplot?


I created a boxplot using the following code:

ggplot(Data_all, aes(y = phase, x = reorder(category, phase), fill = reorder(category, phase))) +
  theme_bw() +
  geom_boxplot(outlier.colour = NULL, outlier.shape = 8, outlier.size = 2, lwd=1) +
  scale_fill_manual(values = c("#FEE391", "#C6DBEF")) +
  theme(plot.margin = unit(c(1.5,1.5,1.5,1.5), "cm"),
        axis.text.x = element_blank(),
        legend.title = element_blank(),
        legend.text = element_text(size = 12))


How can I display the median and the upper/lower quartile?

Thank you in advance!

That is what the boxplot is doing. See Understanding boxplots

Do you want to have the actual values on the plot?

Hey, yes, I want to display the median, the upper and the lower quartile for each box next to it.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.