创建绘图时,只需指定几个选项即可.特别注意axes,type并且xlab:
plot(runif(10), runif(10),
xlim=c(0, 1), ylim=c(0,1),
axes=FALSE, #Don't plot the axis
type="n", #hide the points
ylab="", xlab="") #No axis labels
Run Code Online (Sandbox Code Playgroud)
然后,您可以手动添加y轴:
axis(2, seq(0, 1, 0.2))
Run Code Online (Sandbox Code Playgroud)
并根据需要添加网格
grid(lwd=2)
Run Code Online (Sandbox Code Playgroud)