本文主要是介绍ggplot设置坐标轴标签颜色,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
library(ggplot2)
png(filename = "diamonds-histogram.png",type = "cairo", # 抗锯齿res = 500, # 300ppi 分辨率width = 2400, height = 1800,bg = "transparent" # 透明背景)
ggplot(diamonds, aes(price, fill = cut)) +geom_histogram(binwidth = 500, position = "fill")+theme(axis.text = element_text(colour = 'black'))
dev.off()
ggplot(diamonds, aes(price, fill = cut)) +geom_histogram(binwidth = 500, position = "fill")+theme(axis.text = element_text(colour = 'black'))
ggplot(diamonds, aes(price, fill = cut)) +geom_histogram(binwidth = 500, position = "fill")+theme(axis.text = element_text(colour = 'red'))
这篇关于ggplot设置坐标轴标签颜色的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!