在此总结R语言画图时一些注意事项:
legend: 位置 可用关键词 “bottomright”, “bottom”, “bottomleft”, “left”, “topleft”, “top”, “topright”, “right” and “center”,也可用xy定位。设置颜色,线型,符号,宽度,注意,点的lty属性为-1,同理,线的pch属性也为-1.bty设置无边框"n".
plot函数中,cex.axis设置坐标轴刻度标签的相对大小,cex.lab设置坐标轴label的相对大小
用axis函数当改变坐标轴刻度标签显示时,axis(1,at=seq(from=1,to=96,by=12),labels=c("2001","2002","2003","2004","2005","2006","2007","2008"),cex.axis=2)
创建并保存图片,以tiff为例:
tiff("GPPcomparison_both.tiff",width=800,height=500)
par(mar = c(5,5,4,2)) # 图片在窗口的相对位置
par(mfrow=c(nrows,ncols)) # 几行几列
***具体plot或者barplot等代码
dev.off()