How to plot a stack of curves in Matlab, as attached figure?
조회 수: 3 (최근 30일)
이전 댓글 표시
Hope it is possible with matlab to plot a stack of curves, better with hidden lines, like this attached figure:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/153312/image.jpeg)
댓글 수: 0
답변 (3개)
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);
figure('color', 'k');
[hl,ha] = plotses(x,y);
set(ha, 'xcolor', 'w', 'ycolor', 'k');
set(ha(2:end), 'visible', 'off');
댓글 수: 0
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.
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.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!