how to plot staggered array?
12 ビュー (過去 30 日間)
古いコメントを表示
I want to plot an array with each successive row ("trace") offset slightly to create a staggered array of the data, such as:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/157179/image.jpeg)
How can I eliminate the blank values (i.e. y=0) that are creating those straight lines to the left of each successive trace?
Here is my code (the original data array is named "dF_F"; the number of successive traces is named "cell_num"; the length of each trace is named "scan_num"):
clc;
x_offset=3;
y_offset=1;
a=size(dF_F);
cell_num=a(1,1);
scan_num=a(1,2);
stagger=[cell_num,(x_offset*(cell_num-1)+scan_num)];
fig = gcf;
ax = axes('Parent', fig);
for i=1:(cell_num)
stagger(i,(x_offset*i-1):(x_offset*i-1)+(scan_num-1))=dF_F(i,:);
stagger(i,:)=stagger(i,:)+i;
graph=[stagger(i,:)];
plot(ax, graph,'k');
hold(ax, 'on');
end
0 件のコメント
回答 (3 件)
Star Strider
2016 年 10 月 16 日
There are probably several ways to plot that. I would use the ribbon function, and then experiment with its options to get the result you want.
5 件のコメント
Star Strider
2016 年 10 月 17 日
My pleasure.
As for defining the orientation of the plot, you can set that in your script with the view function. You can rotate the plot in the plot window by clicking on the cube with the anti-clockwise arrow around it on the toolstrip at the the top of the plot figure window. The azimuth and elevation will be displayed in the lower left of the plot figure window. You can manually enter those values as arguments to the view function when you have the view you want.
Image Analyst
2016 年 10 月 17 日
Looks like an output from the waterfall() function. Is waterfall() the function you're looking for?
参考
カテゴリ
Help Center および File Exchange で Graphics Performance についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!