Changing properties of several lines in a plot containing hundreds of lines
1 回表示 (過去 30 日間)
古いコメントを表示
I plot a bunch of lines (~200) using the plot function. Most lines correspond to the trajectories that converge to zero. These twist within a narrow strip.
However, there are 5-10 lines that have different behavior. I do not know apriory [a priori (dpb)] which I'm interested in and identify them by looking at their values at the final time.
Assume that I wish to plot these lines thick or add the legend containing only the items corresponding to these lines. How can I do that?
[T,X]=odexx(...) % here X = [N,M], M>200
plot(T,X) % this plots a bunch of lines
F=X(end,:) % values of the states X at the final time
ind= find(F>0.01) % these are the indices of lines I wish to work with
How can I change the characteristics of the lines with numbers from ind?
0 件のコメント
採用された回答
dpb
2020 年 1 月 18 日
Save the line handles when you plot...
[T,X]=odexx(...)
hL=plot(T,X);
ix=find(X(end,:)>0.01);
set(hL(ix),'LineWidth',2)
legend(hL(ix),num2str(ix(:),'Line #%d'))
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!