我发现我可以获得具有错误轴标签的轮廓线,或者正确的轴标签和没有轮廓线。以下是产生前者的一些代码:
x<-c(1:10)
y<-c(1:10)
z<-matrix(x,nrow=length(x),ncol=length(y))
filled.contour(z,plot.axes = { contour(z, nlevels = 20,
drawlabels = T, axes = FALSE,
frame.plot = FFALSE, add = TRUE);
axis(1); axis(2) } )
这里有一些产生后者:
x<-c(1:10)
y<-c(1:10)
z<-matrix(x,nrow=length(x),ncol=length(y))
filled.contour(x,y,z,plot.axes = { contour(z, nlevels = 20,
drawlabels = T, axes = FALSE,
frame.plot = FFALSE, add = TRUE);
axis(1); axis(2) } )
不同之处在于我指定了x和y值。有人知道如何获得两者吗?
提前举手
答案 0 :(得分:3)
您在x
电话中忘记了y
和contour
:
x<-c(1:10)
y<-c(1:10)
z<-matrix(x,nrow=length(x),ncol=length(y))
filled.contour(x,y,z,plot.axes = { contour(x,y,z, nlevels = 20,
drawlabels = TRUE, axes = FALSE,
frame.plot = FALSE, add = TRUE);
axis(1); axis(2) } )