问题描述
我有个3维数据在MATLAB要绘制。该数据集是由堆叠10指数曲线沿y方向的不同的参数,如
I have a 3-dimensional data to be plotted in matlab. The data set are built by stacking 10 exponential curves with different parameters along y directions such as
x = 0:0.01:15;
x0 = 0.5;
y = [beta1, beta2, beta3, beta4, beta5, beta6, beta7, beta8, beta9, beta10];
Z(1, :) = A*exp(-(x-x0).^2/beta1);
Z(2, :) = A*exp(-(x-x0).^2/beta2);
Z(3, :) = A*exp(-(x-x0).^2/beta3);
Z(4, :) = A*exp(-(x-x0).^2/beta4);
...
Z(10, :) = A*exp(-(x-x0).^2/beta10);
% here A could be change based on beta too (no code shown here)
我想绘制Z间的瀑布,除了我不希望的高度(即垂直线)出现在边缘。我不知道是否有绘制的数据,瀑布般的曲线,但没有这些垂直线,任何其他方式。谢谢
I am trying to plot Z with waterfall except for I don't want the height (i.e. the vertical line) appears on the edge. I don't know if there is any other way to plot the data as waterfall-like curves but without those vertical lines. Thanks
推荐答案
它的曲线,线,而不是补丁与面。
换句话说,你想要的边界线是不可见的。嗯,这不平凡的壮举为边界线是独立于任何颜色方案,你可以直接包含。你需要做的是得到它的数据绘制后,然后相应修改:
"it is plotted with lines instead of patch with surface".
In other words, you want the boundary lines to be invisible. Well that's no trivial feat as the boundary lines are separate from any color scheme you can directly include. What you need to do is get the data after it drawn then modify it accordingly:
例如。
[X,Y,Z] = peaks(30);
h = waterfall (X,Y,Z);
CD = get (h, 'CData');
CD(1,:) = nan;
CD(end-2:end,:) = nan;
set (h, 'CData', CD)
注意 CD(1:)
是上升的边界,而 CD(最终2:最终1 ,: )
是下降的边界, CD(结束,:)
是底部
note that CD(1,:)
is for the "rising" boundary, while CD(end-2:end-1,:)
is for the falling boundary, and CD(end,:)
is for the bottom.
这篇关于寻找的瀑布图在MATLAB中的变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!