Legend entries independent of drawn lines

1 次查看(过去 30 天)
Hey everybody,
as seen in the attached picture I have some lines with two varying parameters c and d. c is represented by a different color and d as a different line style. Now I have 9 entries. I would rather have a legend with just the color X represents c = ... and line style Y represents d = ... That would give me only 6 entries. Is this possible in any way? It is not that bad in the picture, but gets annoying with more lines that I have
At the moment I create my legend like this:
for n = 1:size_c
for k = 1:size_d
legendInfo{:,size_d*(n-1) + k} = ['$c_{AVB}$ = ' num2str(c(n)) ' $\frac{N}{m}$, ' '$d_{AVB}$ = ' num2str(d(k)) ' $\frac{Ns}{m}$'];
end
end
legend(legendInfo,'Interpreter','latex');

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Legend 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by