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

前端 未结 3 1251
花落未央
花落未央 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:16

    So, I couldn't really figure out to do it as proposed in the example I found and posted, but I found a way that works. What I ended up doing was basically this:

    figure
    hold on
    surf(X,Y,Z+1);
    contour(X,Y,Z);
    zz = get(gca,'ZTick');
    set(gca,'ZTickLabel',sprintf('%3.1f\n',zz-1));
    

    This gets me the surf and contour in the same figure, but yields some problems with color mappings.

提交回复
热议问题