i just search a lot but i can't find anything about this problematics. I created a multiple pie chart plot with the command facet grid but as i can see, i have the panel grid labels badly placed, with partial overlay with pie charts. Is there a method to regulate their distance from the pie chart?
Here the code i write to create the graphs, the dataset is a small example of how my data are organize:
library(ggplot2)
library(ggpubr)
library(extrafont)
library(readxl)
Specie <- c("Avena spp", "Avena spp","Avena spp", "Ranunculus spp", "Ranunculus spp",
"Ranunculus spp", "Rumex acetosa spp","Rumex acetosa spp","Rumex acetosa spp")
Plantdensity <- c(140, 100, 30, 29, 32, 16, 10, 5,2)
Cluster <- c("Wc1", "Wc2","Wc3","Wc1", "Wc2","Wc3","Wc1", "Wc2","Wc3")
data_of_weeds <- data.frame(Specie, Plantdensity,Cluster)
tickname <- c("Wc1" = "Weed-Community 1",
"Wc2" = "Weed-Community 2",
"Wc3" = "Weed-Community 3")
tema_piechart <- theme (panel.background = element_blank(),
axis.title.x = element_text(family = "Arial",color = "black"),
axis.line = element_line(colour = "black"),
text = element_text(size = 20),
axis.title.y = element_blank(),
axis.ticks.length.y = unit( 0, "cm"),
legend.position = "none",
panel.grid.major = element_line(colour = "black"),
axis.text = element_text(color = "black", size = 10)
)
pc <- ggplot(data_of_weeds,
aes(x = "", y = Plantdensity, fill = Specie))+
geom_bar(width = 1, stat="identity", color = "black") +
coord_polar("y", start = 0) +
facet_grid(.~ Cluster, labeller = as_labeller(tickname))
pc1 <- pc + tema_piechart + theme(strip.background.x = element_rect(fill="white"))+
theme(strip.text.y = element_text(hjust = 10))
I just tried the "vjust" or "hjust" flags but didn't works.
Edit:
As you can see the number (0,50,100,150) are touching the black line. Is there a method to shift so they didn't touch le line?