Amr*_*mro 10
请考虑以下示例:
%# plot surface and contour
Z = peaks;
surf(Z), hold on
[~,h] = contourf(Z); %# get handle to contourgroup object
%# change the ZData property of the inner patches
hh = get(h,'Children'); %# get handles to patch objects
for i=1:numel(hh)
zdata = ones(size( get(hh(i),'XData') ));
set(hh(i), 'ZData',-10*zdata)
end
Run Code Online (Sandbox Code Playgroud)
以上在HG2中不再起作用.它可以使用轮廓的隐藏属性来修复ContourZLevel
:
Z = peaks;
surf(Z), hold on
[~,h] = contourf(Z);
h.ContourZLevel = -10;
Run Code Online (Sandbox Code Playgroud)
您还可以使用hgtransform
实现类似的东西,这是记录和推荐的方法.
请参阅我的另一个答案以获得进一步的解释:在一个三维图中绘制多个2d等高线图.