I am using geom_label_repel but the labels didn't place on the areas correctly this is my data
subject |n |prop
A | 9| 22%
B |10|24%
C |12|29%
D |10|24%
this my code
df=df %>%
arrange(desc(subject)) %>%
mutate(prop = percent(n/41)) -> df
pie <- ggplot(df, aes(x = "", y = n, fill = fct_inorder(subject))) +
geom_bar(width = 1, stat = "identity")+
coord_polar("y", start = 0) +
geom_label_repel(aes(label =paste0(prop) ), size=5,show.legend=F, nudge_x =-3,nudge_y=32,segment.size=0.5,direction ="both",hjust="inward",vjust="inward")+
guides(fill = guide_legend(title="elective course"))
theme_void()
pie
As you can see they are pointing to wrong areas can you help me please to fix this