|
[img]file:///C:\Users\LB\Documents\Tencent Files\121537351\Image\Group\Q7O7HUA{$OR_Z_@M7%YP@GP.jpg[/img]请教一下,我想在玫瑰图中直接标出y轴的标签,不知道怎么实现,目前的代码是:
library(ggplot2)
library(tidyverse)
mydata<-data.frame(a=c("Mon","Tues","Wed","Thur","Fri","Sat","Sun"),b=c(50,60,70,20,90,110,30))
myangle<-seq(-20,-340,length.out=7)
mydata%>%mutate(re=factor(a,levels=c("Mon","Tues","Wed","Thur","Fri","Sat","Sun")))%>%
ggplot(aes(x=re,y=b,fill=factor(b)))+
geom_bar(width=1,stat="identity",colour="black",fill="#F8766D")+
geom_text(aes(y=b-8,label=b),colour="white")+
coord_polar(theta="x",start=0)+ylim(-20,120)+
theme_light()+
theme(axis.text.x=element_text(size=13,colour="black",angle=myangle))
|