I want to create a pie chart with only the pie-circle displayed using ggplot2 and geom_col in R, so that the entire plot is just the pie-circle without any space on each side. Below is an example of my code:
library('ggplot2')
df = data.frame(group=c("a","b","c"),
value=c(0.2,0.4,0.4))
p=ggplot(df,aes(x="", y=value, fill=group)) +
geom_col(position="fill") +
coord_polar(theta = "y") +
guides(fill=F) +
theme(
panel.background = element_rect(fill = "grey", colour = NA),
#"grey" is just to show the panel area
plot.background = element_rect(fill = "transparent", colour = NA),
panel.grid = element_blank(),
panel.border = element_blank(),
plot.margin = unit(c(0, 0, 0, 0), "null"),
panel.spacing = unit(0, "null"),
axis.ticks = element_blank(),
axis.text = element_blank(),
axis.title = element_blank(),
axis.line = element_blank(),
legend.position = "none",
axis.ticks.length = unit(0, "null"),
axis.ticks.margin = unit(0, "null"),
legend.margin = margin()
)
Below is the figure it created. What I wanted is to have the top and bottom of the circle be at the top and bottom edge of the grey area. How do I do that?

