gpt-3.5-turbo-0613· OpenAI
WildChat-4.8M (AI2)
ggplot(Pla, aes(x = (Test), y = Poids, fill = Jour)) + geomboxplot() + labs(title =…
- User
ggplot(Pla, aes(x = (Test), y = Poids, fill = Jour)) + geom_boxplot() + labs(title = "Comparaison Poids pour Abricot à J3,J7", x = "Substrat", y = "Poids") + scale_fill_manual(values = c(J3="blue",J7="red")) + theme_minimal() + scale_y_continuous(trans = 'log10') ajout p value wilcoxon
- Assistant
You can add the p-value from the Wilcoxon test to the plot by using the
geom_text()function. Here's an example of how you can do it:ggplot(Pla, aes(x = Test, y = Poids, fill = Jour)) + geom_boxplot() + labs(title = "Comparaison Poids pour Abricot à J3,J7", x = "Substrat", y = "Poids") + scale_fill_manual(values = c(J3 = "blue", J7 = "red")) + theme_minimal() + scale_y_continuous(trans = 'log10') + geom_text( x = 1, y = max(Pla$Poids), label = paste("p =", wilcox.test(Poids ~ Jour, data = Pla)$p.value), hjust = 1.2, vjust = 1.2, color = 'black' )This code will add the p-value to the top right corner of the plot. Adjust the
xandyvalues as needed to position the text appropriately.