ggplot2坐标系列的调整

ggplot(kegg_class,aes(x = Description,y = Count)) + geom_bar(aes(fill = source),stat = "identity",width = 0.5,position = "dodge") + scale_fill_manual(values = c(up = "#ca0020",down = "#2b83ba")) + theme_classic()+
scale_y_continuous(expand = c(0,0))+ #去掉与Y轴间隙
labs(x = "" , y = "count",title = "")+ #修改x,y轴的标题
theme(axis.title.x = element_text(size = 14,face = "bold"),axis.title.y = element_text(size = 14,face = "bold"))+ # x轴标题,y轴标题字体的大小
theme(axis.text.x = element_text(size = 9,face = "bold"),axis.text.y = element_text(size = 9,face = "bold"))+ #修改x,y轴刻度线上的大小
theme(axis.ticks.y = element_blank())+ # 只删掉y轴的刻度线,theme(axis.ticks = element_blank()) 删掉所有的刻度线
theme(legend.position = "right") + # legend的位置,可旋转right,left,top,bottom,none
theme(legend.position = c(0.7,0.3))+#legend.position也可以用两个元素构成的数值向量来控制,主要是设置图例在图片中间所在具体位置
coord_flip()

你可能感兴趣的:(ggplot2坐标系列的调整)