Bonjour,

Je voudrais savoir comment mettre les valeurs de chaque portions sur un plot en forme de camembert.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 
df <- data.frame(
  Libellé = c("Male", "Female", "Child"),
  Pourcentage = c(25, 25, 50)
)
 
ggplot(df, aes(x="", y=Pourcentage, fill=Libellé))+
  geom_bar(width = 1, stat = "identity") + 
  coord_polar("y", start=0) +
 
  geom_text(aes(y = ), 
                label = Pourcentage)) +
 
  theme(axis.text.x=element_blank(),
          axis.title.x = element_blank(),
          axis.title.y = element_blank(),
          panel.border = element_blank(),
          panel.grid=element_blank(),
          axis.ticks = element_blank(),
          plot.title=element_text(size=14, face="bold"))