How to plot a stack of curves in Matlab, as attached figure?

1 回表示 (過去 30 日間)
John
John 2013 年 11 月 27 日
編集済み: Kelly Kearney 2014 年 6 月 12 日
Hope it is possible with matlab to plot a stack of curves, better with hidden lines, like this attached figure:

回答 (3 件)

Kelly Kearney
Kelly Kearney 2014 年 6 月 12 日
編集済み: Kelly Kearney 2014 年 6 月 12 日
The easiest way is probably just to add a small offset to the ydata:
nx = 100;
ny = 50;
ysig = rand(nx,1);
x = 1:(nx+ny);
y = nan(nx+ny,ny);
for ii = 1:50
y(ii:(ii+nx-1),ii) = ysig;
end
dy = 1;
ystaggered = bsxfun(@plus, y, (0:ny-1)*dy)
figure('color','k');
axes('color', 'k', 'xcolor','w');
line(x, ystaggered);
You could also try creating a lot of overlapping axes (as with plotses).
figure('color', 'k');
[hl,ha] = plotses(x,y);
set(ha, 'xcolor', 'w', 'ycolor', 'k');
set(ha(2:end), 'visible', 'off');

Walter Roberson
Walter Roberson 2013 年 11 月 27 日
That appears to be a waterfall plot. Which is actually a mesh plot with lines drawn only in one direction.
  1 件のコメント
John
John 2014 年 6 月 12 日
waterfall will not do that well. 1) waterfall is a 3D looking with view angles; 2) if plot black, the baseline will be plot, very ugly and messy; 2) with 'column' or 'raw' line only, there are missing sections.
Anyways, the water fall isn't a good way. Above is plot with IDL.

サインインしてコメントする。


Star Strider
Star Strider 2014 年 6 月 12 日
My choice would be to use a ribbon plot. Then play with the plot parameters until it looks the way you want it to.

カテゴリ

Help Center および File ExchangeGraphics についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by