我想用 coord_polar 在 ggplot 周围制作弯曲文本。我有数据框:
z <- data.frame( a=c("sensor 1","sensor 2","sensor 3","sensor 4","sensor 5","sensor 6","sensor 7","sensor 8"), b=c(50, 60, 70, 20,90,110,30,100))
这是我创建 ggplot 的代码:
cxc <- ggplot(z, aes(x=a, y=b, fill=factor(b))) +
geom_bar(width = 1,stat="identity",colour = "black")
cxc + coord_polar() +
theme_linedraw() +theme(axis.ticks =element_blank(), axis.text.y =element_blank(), axis.title=element_blank(), axis.text.x=element_text(size = 12,angle = 45))
Here is image from my result. I want making texts (x axis): sensor 1, sensor 2... making curved like I draw with red color around circle from coord_polar. Must fit with circle.