Stacking multiple 2D plots into a single 3D plot in MATLAB

后端 未结 2 1285

I have multiple FFT plots and I want to show them together in one plot, something like the attached figure.

\"en

2条回答
  •  渐次进展
    2021-01-02 18:49

    To improve readability of the plot created in the @rayryeng answer one may also add white stripes below each line that will block deeper lines (DZ controls stripe width which is set to 10% of the Z-axis span):

    ZL = zlim(gca);
    DZ = 0.1*(ZL(2)-ZL(1));
    for k=1:size(xMat,2);
        hPatch(k) = patch( ...
            [xMat(:,k);    flipud(xMat(:,k))   ], ...
            [yMat(:,k);    flipud(yMat(:,k))   ], ...
            [zMat(:,k);    flipud(zMat(:,k))-DZ], ...
            'w');
        set(hPatch(k), 'EdgeColor','none', 'FaceColor','w', 'FaceAlpha',0.9 );
    end
    axis tight
    

提交回复
热议问题