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?

采纳的回答

dpb
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 个)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by