How to plot multiple lines with same legend handle?
显示 更早的评论
Hi, I know this looks like a lot, but it I think this is a simple fix. In the second to last line of code, I have my legend line. In the lines above that, I create the arrays for n, t, and m. As you can see on the right side, they are all arrays of different lines. I need to assign n, t, and m a unique legend name, but I can't right now because they are differently sized arrays. Please help me to somehow merge the lines into one continuous line or some other workaround.
Thanks

3 个评论
Ameer Hamza
2020-4-25
In the line
n = plot(.....
Why are you plotting several lines with same color. Isn't it better to plot just one line
n = plot([l(logical(S1)) l(logical(S2))], [MN1 MN2], 'r');
change it accordingly if l, MN1 and MN2 are column vectors.
matlabuser
2020-4-25
Ameer Hamza
2020-4-25
I am glad to be of help.
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Legend 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!