R语言中plot绘图函数中的参数选项

 

001、frame.plot = T参数绘图 设置是否显示图边框

par(mfrow = c(1,2))
plot(1:10, cex = 3, pch = 19, frame.plot = T, main = "111")         ## 显示图边框
plot(1:10, cex = 3, pch = 19, frame.plot = F, main = "222")         ## 不显示图边框

。 

 

002、type设置散点输出类型

par(mfrow = c(3,3))
plot(1:10, cex = 3, pch = 19, type  = "p", main = "ppp")
plot(1:10, cex = 3, pch = 19, type  = 'l', main = "lll")
plot(1:10, cex = 3, pch = 19, type  = 'b', main = "bbb")
plot(1:10, cex = 3, pch = 19, type  = 'c', main = "ccc")
plot(1:10, cex = 3, pch = 19, type  = 'o', main = "ooo")
plot(1:10, cex = 3, pch = 19, type  = 'h', main = "hhh")
plot(1:10, cex = 3, pch = 19, type  = 's', main = "sss")
plot(1:10, cex = 3, pch = 19, type  = 'S', main = "SSS")
plot(1:10, cex = 3, pch = 19, type  = 'n', main = "nnn")

 

 

003、bty参数设置框线的类型

par(mfrow = c(3,3))
plot(1:10, cex = 3, pch = 19, bty  = "o", main = "ooo")
plot(1:10, cex = 3, pch = 19, bty  = "n", main = "nnn")
plot(1:10, cex = 3, pch = 19, bty  = "l", main = "lll")
plot(1:10, cex = 3, pch = 19, bty  = "7", main = "777")
plot(1:10, cex = 3, pch = 19, bty  = "c", main = "ccc")
plot(1:10, cex = 3, pch = 19, bty  = "u", main = "uuu")
plot(1:10, cex = 3, pch = 19, bty  = "]", main = "]]]")

 

004、 plot绘图函数中增加网格线

par(mfrow = c(1, 2))
plot(1:10, cex = 3, pch = 19, main = "no grid")
plot(1:10, cex = 3, pch = 19, panel.first = grid(4,4, col = "red", lty = 1), main = "grid")

 。

 

005、xaxs参数设置 坐标轴起点

par(mfrow = c(1,2))
# 坐标轴延长
plot(0:10, 0:10, cex = 3, pch = 19, xaxs = 'r',yaxs = 'r', main = "xaxs = 'r'")
plot(0:10, 0:10, cex = 3, pch = 19, xaxs = 'i',yaxs = 'i', main = "xaxs = 'i'")

 。

 

posted @ 2024-06-01 19:59  小鲨鱼2018  阅读(38)  评论(0编辑  收藏  举报