R命令如下:
x<-y<-seq(-1, 1, 0.04)
f<-function(x,y) 0.2480+0.0527*(x+y)+0.058*x*y-0.0424*(x^2+y^2)-0.0014*(x*y^2+x^2*y)+0.0172*x^2*y^2-0.0432*(x^3+y^3)-0.0335*(x^3*y+x*y^3)+0.0049*(x^2*y^3+x^3*y^2)+0.0203*x^3*y^3
z<-outer(x, y, f)
contour(x,y,z,col="blue")
persp(x,y,z,theta=-30, phi=10,expand=0.9,col="lightblue",xlab="weeks",ylab="weeks",zlab="genetic (co)variances")
问题是如何加上坐标轴刻度?就像附图.
多谢达人帮助! |