我觉得挑战是,建立在R.美观的三维曲面我熟悉的解决方案(persp
,image
,wireframe
,lattice
,rgl
和几个在SO其他问题的其他解决方案),但是结果不是很好.
是否可以像在MATLAB中一样在R中创建3D曲面图?
Here is the MATLAB code % Create a grid of x and y points points = linspace(-2, 0, 20); [X, Y] = meshgrid(points, -points); % Define the function Z = f(X,Y) Z = 2./exp((X-.5).^2+Y.^2)-2./exp((X+.5).^2+Y.^2); % "phong" lighting is good for curved, interpolated surfaces. "gouraud" % is also good for curved surfaces surf(X, Y, Z); view(30, 30); shading interp; light; lighting phong; title('lighting phong', 'FontName', 'Courier', 'FontSize', 14);
情节现代,色彩鲜艳,美观,代码语法非常易读.
这可能在基地R?