Changing properties of several lines in a plot containing hundreds of lines
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Dmitry Gromov
am 18 Jan. 2020
Kommentiert: Dmitry Gromov
am 19 Jan. 2020
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 Kommentare
Akzeptierte Antwort
dpb
am 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'))
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!