Changing properties of several lines in a plot containing hundreds of lines

1 view (last 30 days)
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?

Accepted Answer

dpb
dpb on 18 Jan 2020
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'))

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!