Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个图,其中绘制了 15 个数据集及其趋势线(lslines)。如果我使用命令图例,它会显示所有数据集和 lslines,总共 30 个图例。但我想忽略 lslines 的传说。这怎么可能?
存储每个绘制数据集的句柄并使用它们创建图例:
figure hold on h1 = plot(rand(1,10),'b'); h2 = plot(rand(1,10),'r'); h3 = plot(rand(1,10),'g'); legend([h1,h3],'data 1','data 3') %displays a legend for the first and third plot but not the second plot