开发者

MATLAB Legend Groups

I'm using MATLAB to plot some data. I would like to create the legend so that it divides information into two types, say Type1 and Type2. Each type of data has several specific lines of data which i am plotting. Suppose that:

  • Type1 data has line1 and line2
  • Type2 data has line1 and line2 and line3

This would make a 5 line plot. Now for the legend i can do something like:

legend('Type1: line1','Type1: line2','Type2: line1', ...
       'Type2: line2','Type2: line3');

But that repeats the 'Types' and the best way would be something that would look like:

(final legend output)

  • Type1:
    • line1
    • line2
  • Type2:
    • line1
    • line2
    • line3

Thanks a lot. Hope you can help wi开发者_如何学Pythonth my first question here :D


You may want to have a look at LEGENDFLEX that you can download from the Matlab File Exchange

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜