我想使用axis()在图表的右上方创建一个带刻度和标签的图。如何抑制使用plot()函数“自动”打印的刻度线和标签?谢谢
x<-1:10
y<-1:10
quartz("test")
par(mar=c(10,10,10,10)+0.1)#sets margins of plotting area
par(pty="s")#fixes the aspect ratio to 1:1
#Automatically adds ticks, numbers and axis labels. How can I avoid this?
plot(x,y,typ="n")
#Adds axes above and to the right of plot area...I want these only
axis(side=4,las=2, ylab="y label")
axis(side=3,las=1,xlab="x label")
答案 0 :(得分:3)
请参阅?plot.default
:
plot(x, y, type="n", axes=FALSE, frame.plot=TRUE, xlab="", ylab="")