Put stars on ggplot barplots and boxplots - to indicate the level of significance (p-value)
It's common to put stars on barplots or boxplots to show the level of significance (p-value) of one or between two groups, below are several examples: The number of stars are defined by p-value, for example one can put 3 stars for p-value < 0.001, two stars for p-value < 0.01, and so on (although this changes from one article to the other). And my questions: How to generate similar charts? The methods that automatically put stars based on significance level are more than welcome. Please find my attempt below. First, I created some dummy data and a barplot which can be modified as we wish.