在R中使用surf3D或persp3D,我试图重现Maple的以下绘图函数:
>plot3d(Re(sqrt(15/(8*Pi))*(sin(theta)*cos(theta)*exp(I*phi)))^2,phi=0..2*Pi,theta=0..Pi,coords=spherical,scaling=constrained,style=patchcontour,numpoints=5000,axes=frame)要获得与以下可见图相似(或更好)的内容:

在我亲自调查这个问题之前,有没有人有一个快速的答案?
提前感谢您的帮助。
发布于 2018-08-07 04:10:49
这里是我认为的一部分(还是完整的?)解决方案(也许我们可以做得更好、更简单,例如,包括等参曲线和应该是红色的颜色,因为我们离中心很远,而不仅仅是在垂直轴z上):
library("plot3D")
theta<-seq(from = 0, to = pi, by = pi/320)
phi<-seq(from = 0, to = 2*pi, by = pi/160)
m<-length(phi); n=length(theta)
Phi<-matrix(rep(phi,each=n),nrow=n)
Theta<-matrix(rep(theta,m),nrow=n)
r = Re(1/2*sqrt(15/(2*pi))*exp(-1i*Phi)*sin(theta)*cos(Theta))
x = r*cos(Phi)
y = r*sin(Phi)
z = r*cos(Theta)
surf3D(x, y, z,colkey=TRUE,box=TRUE,bty="b2",main="A Spherical Harmonic")结果是:

https://stackoverflow.com/questions/51697361
复制相似问题