I would like to build a polar plot and I used a script similar to one of another discussion. However I'm not able to increase the distance of the letters (representing the categories) from the border; Below you can find the data and the script.
library(tidyverse)
dd <- tibble(category = c('A', 'B', 'C'), value = c(2, 7, 4))
coord_straightpolar <- function(theta = 'x', start = 0, direction = 1, clip = "on") {
theta <- match.arg(theta, c("x", "y"))
r <- if (theta == "x")
"y"
else "x"
ggproto(NULL, CoordPolar, theta = theta, r = r, start = start,
direction = sign(direction), clip = clip,
# This is the different bit
is_linear = function(){TRUE})
}
ggplot(dd, aes(x = category, y = value, group=1)) +
coord_straightpolar(theta = 'x') +
geom_polygon(color = 'blue', alpha = 0.0001) +
scale_y_continuous(limits = c(0, NA)) +
geom_point() +
theme(panel.grid.major= element_line(color="grey", linewidth=0.6),
axis.text.y = element_blank(),
axis.ticks.y = element_blank(),
axis.text.x = element_text(vjust = 10, size=13),
legend.position = "none"
)
To increase the distance of the letters I tried with axis.text = element_text(vjust=10) but without success. Thank you for your help!