ggplot(diamonds,aes(cut))+geom_bar(aes(fill=color),position="fill")+labs(y="precentage/%")+scale_y_continuous(limits=c(0,1),expand=c(0,0),breaks=seq(0,1,0.2),labels=seq(0,100,20))+theme(panel.background=element_blank(),axis.title.x=element_blank(),axis.line.y=element_line(),legend.position="bottom",legend.direction="horizontal",legend.title=element_blank(),legend.key.size=unit(1,'cm'))
关于图例中每个小框框(好像叫key)之间的距离(看起来更饱满一些),排列(比如只排一行),以及每个框框与相应文字之间距离。如何使用theme中的参数进行调整。小白求解


雷达卡




京公网安备 11010802022788号







