R语言中axis 中调整标签与轴线的距离

 

使用 padj参数调整垂直距离;

使用hadj参数调整水平距离; 

 

001、padj参数

par(mfrow = c(2,1))
plot(1:10, cex = 2, pch = 17, xaxt ="n", xlab = "", main = "0.5")
axis(1, at=seq(0, 10, 5), cex.axis=2,font = 2, line = 1, col.axis  = "red", padj = 0.2) 

plot(1:10, cex = 2, pch = 17, xaxt ="n", xlab = "", main = "1")
axis(1, at=seq(0, 10, 5), cex.axis=2,font = 2, line = 1, col.axis  = "blue", padj = 1)

 

 

002、hadj参数

par(mfrow = c(2,1))
plot(1:10, cex = 2, pch = 17, xaxt ="n", xlab = "", main = "0.5")
axis(1, at=seq(0, 10, 5), cex.axis=2,font = 2, line = 1, col.axis  = "red", hadj = 0.5) 

plot(1:10, cex = 2, pch = 17, xaxt ="n", xlab = "", main = "1")
axis(1, at=seq(0, 10, 5), cex.axis=2,font = 2, line = 1, col.axis  = "blue", hadj = 1)

 

posted @ 2023-01-07 21:30  小鲨鱼2018  阅读(627)  评论(0编辑  收藏  举报