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

1 vue (au cours des 30 derniers jours)
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?

Réponse acceptée

dpb
dpb le 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'))

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by