Shift the z -value of contour plot in Matlab 2014b

前端 未结 3 1259
花落未央
花落未央 2021-01-23 11:28

I\'m trying to make a figure of a surface plot, and beneath the surface I wish to show the contour lines, but I want the contour to be at z = -1 instead of at the d

3条回答
  •  庸人自扰
    2021-01-23 12:27

    I got the same problem. And finally, I got the contourf on plane Z=-10. My MATLAB version is

    MATLAB Version: 8.5.0.197613 (R2015a)

    hope the codes work 4 you

    clear all
    clc
    
    [X,Y,Z] = peaks;
    
    [~,hContour] = contourf(X,Y,Z,20,'edgecolor','none');
    
    hContour.ContourZLevel = -10; % set the contour's Z position
    
    view(44,30)
    
    colormap(jet)
    

提交回复
热议问题