I am trying to build a polar plot to showcase percentiles in certain directions but having trouble removing the outer most ring of the polar plot even though it has been removed as part of the bar plot that helps build the polar plot.
Here is the reproducible code:
library(ggplot2)
perc_df=data.frame(id=c(125,126,127,128,129,130),percentile=c(.50,.75,.99,.27,.12,.66))
cxc <- ggplot(perc_df, aes(x = id)) +
geom_bar(width = 1, aes(weight = percentile, fill = ..count..)) +
scale_y_continuous(limits = c(0,1),breaks=seq(0, 1, .25),expand=c(0,0)) +
scale_fill_gradient2(low = 'red', high = 'green',mid='yellow', limits=c(0,1),midpoint=.5,guide = "colourbar")
cxc + coord_polar(theta = 'x',start = 2.6)+ guides(fill=FALSE) +
theme(axis.title.x=element_blank(),axis.text.x=element_blank(),axis.ticks.x=element_blank(),axis.title.y=element_blank(),
axis.text.y=element_blank(),axis.ticks.y=element_blank(),plot.title = element_text(lineheight=.8, face="bold",hjust = 0.5),
panel.border = element_blank())
This is what is produced:
This is very close but we want percentiles of 1 to be at the final circle of the plot rather than having that outer ring of the plot.
Edit: I have already tried to incorporate the answers here but without any luck. Remove extra space and ring at the edge of a polar plot