Set same color order for plots and legend
Mostra commenti meno recenti
Hello,
I have a problem to connect plot with legend. There are a variable number of plots and legends, so there are not fixed values.
Of course of this I can't use
p1 = plot(....
p2 = plot(....
legend([p1 p2],{'Test1','Test2'})
Me also take the filenames like legend entries.

The big problem — the colors of plots and legend are different (there are not connected with each other)
But I think about one workaround. Index of my files is still the same (here 1,2,3) so can I adjust to getting same colors in plots and legend?
(r, g, b)?
Thank you!
Risposte (1)
Nik Rocky
il 25 Giu 2020
Categorie
Scopri di più su Legend in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
