Hello,(adsbygoogle = window.adsbygoogle || []).push({});

I am trying to do the following:

for i=1:3

semilogy(plot1,'r(-,:,d)',plot2,'b(-,:,d)',plot3,'k(-,:,d)');

legend('i legend1','i legend2',''i legend1'')

end

where I need to draw the same plots under different settings, such that each function has the same color under the different settings, but with different style, e.g: solid line in the first, dotted in the second, ... and so on. I also want to include the number i in the legend at each iteration. How to do that?

Thanks

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Dynamic Legend in MatLab

**Physics Forums | Science Articles, Homework Help, Discussion**