How to label a graph in Matlab without using text command
6 views (last 30 days)
Show older comments
Hello
I plotted 100 graphs in Matlab using plot function (all in one Figure). I need to label them from 1 to 100. I don't want to/can't use the text command since it requires me to put the X and Y coordinations which is such a hassle and also add at least 100 line to my code.
Is there any way to label graphs, and let Matlab where tu put those labels (numbers in my case)?
Regards,
Benjamin
0 Comments
Answers (1)
Walter Roberson
on 21 Nov 2019
If you have a quite new release (R2019a or later I think it is) then you can use legend() with the NumColumns option. The maximum number of legend items per column is 50 if I recall correctly.
100 legend labels takes up quite a bit of space on the screen.
Even if you use different combinations of color and markers and line styles, it is difficult to make 100 distinguishable lines on one plot.
2 Comments
Walter Roberson
on 23 Nov 2019
Nothing like that appears to be available for lines (just for points). Vaguely related material is at
See Also
Categories
Find more on 2-D and 3-D Plots 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!