标签:label .com 参数 范围 img 文字 image 通过 log
adj 用来控制文字的对齐方式,取值范围为0到1,控制图片中x轴和y轴标签,标题,以及通过text 添加的文字的对齐方式
0表示左对齐,代码示例:
par(adj = 0)
plot(1:5, 1:5, type = "n", main = "title", xlab = "x", ylab = "y")
abline(h = 3, lty = 2)
abline(v = 3, lty = 2)
text(x = 3, y= 3, label = "text", cex = 2)
效果图如下:
0.5为默认值,表示居中对齐,代码示例:
par(adj = 0.5) plot(1:5, 1:5, type = "n", main = "title", xlab = "x", ylab = "y") abline(h = 3, lty = 2) abline(v = 3, lty = 2) text(x = 3, y= 3, label = "text", cex = 2)
效果图如下:
1代表右对齐,代码示例:
par(adj = 1) plot(1:5, 1:5, type = "n", main = "title", xlab = "x", ylab = "y") abline(h = 3, lty = 2) abline(v = 3, lty = 2) text(x = 3, y= 3, label = "text", cex = 2)
效果图如下:
标签:label .com 参数 范围 img 文字 image 通过 log
原文地址:http://www.cnblogs.com/xudongliang/p/6841497.html