I want to create the same plot, and make sure that ggplot using the full layout of the chart when i save the plot (not half)
library(tidyverse)
df <- tibble(x = 1, percent = 54.2) %>%
mutate(title = paste0(percent, "%"))
ggplot(df, aes(xmin = 1, xmax = 1.5, ymin = 0, ymax = percent)) +
geom_rect(aes(xmin = 1, xmax = 1.5, ymin = 0, ymax = 100), fill = "#ece8bd") +
geom_rect(fill = "#47d22d") +
xlim(c(0, 1.5)) +
ylim(c(0,200)) +
geom_text(aes(x = 0, y = 0, label = title),
colour = "black", size = 10) +
coord_polar(theta = "y", start = -pi/2) +
theme_void() +
theme(plot.margin = unit(rep(0, 4), "cm"))
ggsave("x.png", width = 4, height = 4, bg = "transparent")