How to identify which lines in the plot correspond to which legend entry?
13 views (last 30 days)
Show older comments
Commented: Waseem Akhtar on 1 Sep 2021
I have a figure with multiple lines and legend entries as attached figure. Since the colours of lines are repeating several times, it's difficult to identify which line of graph corresponds to which legend.
Suggest an easy solution, please.
Mathieu NOE on 1 Sep 2021
do we really need to see all those horizontal lines ? does it bring any valuable info ?
I am not sure, but I guess we could plot the data differently.
as there is no y variation we could simply plot the y mean values versus the z data (that appears for the time being in the legend)
so at the end we would simply have a 2D plot of mean(y) vs z and no need for this huge legend
Walter Roberson on 1 Sep 2021
Edited: Walter Roberson on 1 Sep 2021
ax = gca;
and now you will want to zoom in to different areas (the xlim and ylim you have in effect is only the last segment of some of the lines.)
More Answers (0)
Find more on Legend in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!