使用matlab的内置peaks
或类似函数的工作示例可以;
contour3
类似但与mesh/surf
我尝试了有关轴句柄的文档属性但是失败了。为了获得这样的数字,可能需要一些无证的特征?
答案 0 :(得分:1)
您可以通过创建新轴来添加等高线图(第3点):
[xz,y,z] = peaks;
f = figure;
[~, hc] = contourf(xz, y, z);
a1 = gca;
a2 = axes('Parent', f, 'Position', a1.Position);
hs = surf(xz, y, z, 'Parent', a2);
a1.Color = 'none';
a2.Color = 'none';
a1.ZLim = [0 1];
a2.ZLim = [-9 9];
a1.XTick = [];
a1.YTick = [];
a1.ZTick = [];
a1.Box = 'off';
a2.Box = 'off';
% Call after setting desired view on a2 (surf plot)
a1.View = a2.View;
在MATLAB 2014b上生成: