I understand this question has been asked before, but in using some of the past answers I still cannot produce the radar chart I would like. I have used this, as an example of a radar chart I am trying to reproduce. But I can't seem to figure out the last bits.
I am a unhappy with the following: 1. The polar grid on the background. How do I create one such that it does go through the middle of every bar? It looks like it does at first, but then stops and I cannot figure out why. If I cannot make it go through the middle, then I would like it to go on the outside of each bar. If that doesn't work, then maybe just slice the radar chart into 8 equal sections? 2. Why is there a width between some bars, but others not so much.
Code:
t<-12
angle_bucket<-seq(0,2*pi-2*pi/t,2*pi/t)
angle_group<-seq(1,length(angle_bucket),1)
meanL<-c(17.289,20.7857,18.675,10.4,0,0,22.1,19.5,18.02,19.5,30.35,29.83)
normized<-c(1,0.368,0.2105,0.05263,0,0,0.10526,0.21056,0.5263,0.157894,0.7368,0.8421)
ang_dfp<-data.frame(angle_bucket,angle_group,meanL,normized)
ang_dfp$angle_group<-as.factor(ang_dfp$angle_group)
ang_dfp$angle_bucket<-ang_dfp$angle_bucket+2*pi/t/2
p<-ggplot()+
geom_bar(data=ang_dfp,aes(x=angle_bucket,y=normized, fill=meanL), stat = "identity")+
scale_fill_viridis_c(alpha=1,begin=0,end=1,direction=-1,option='plasma',aesthetics ='fill')+
scale_x_continuous(breaks = 0:nlevels(ang_dfp$angle_group))+
#Theme
theme_minimal()+
theme(
panel.background = element_rect(fill = "transparent", colour = NA),
axis.title = element_blank(),
axis.ticks = element_blank(),
axis.text=element_blank(),
axis.line=element_blank(),
plot.margin = unit(c(0.1,0.1,0.1,0.1), "cm"),
plot.background = element_rect(fill = "transparent", colour = NA),
legend.position = 'none'
)+
coord_polar(theta='x',start=0,direction=-1)
p

