Data labels are not fitting into the gauge panel

Hello all, please I will need help to visualize the fittings of the data labels clearly in the gauge plot.

Below is the code and a screenshot of the result.

....
ggplot()+
geom_polygon(data=get.poly(breaks[1],breaks[2]),aes(x,y),fill="forestgreen")+
geom_polygon(data=get.poly(breaks[2],breaks[3]),aes(x,y),fill="gold")+
geom_polygon(data=get.poly(breaks[3],breaks[4]),aes(x,y),fill="red")+
geom_text(data=as.data.frame(breaks), size=4.5, fontface="bold", vjust=0, hjust=0, color="#FFFFFF",
aes(x=cos(pi*(1-breaks/100)),y=sin(pi*(1-breaks/100)),label=c("","Promoters", "Passive", "Detractors")))+
annotate("text",x=0,y=0,label=round(pos, digits = 2),vjust=0,size=12,fontface="bold", color="#FFFFFF")+
coord_fixed() +
theme_bw()+
theme(axis.text=element_blank(),
axis.title=element_blank(),
axis.ticks=element_blank(),
panel.background=element_rect(fill="#0D0D0D"),
plot.background = element_rect(fill = "#0D0D0D"),
panel.grid=element_blank(),
panel.border=element_blank())
}
Screenshot 2022-07-14 220655

Thank you!

Hello.
Thanks for providing code , but you could take further steps to make it more convenient for other forum users to help you.

Share some representative data that will enable your code to run and show the problematic behaviour.

You might use tools such as the library datapasta, or the base function dput() to share a portion of data in code form, i.e. that can be copied from forum and pasted to R session.

Reprex Guide

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.