I wish to make a legend plot that separates 2 experiments by color while sepparating the inputs by line style, inputs for both experiments were the same. What is the best way to go about making a legend like this?

Antworten (2)

madhan ravi
madhan ravi am 18 Okt. 2020

0 Stimmen

plot(1:5, '-k')
hold on
plot(6:10, ':y')
legend({'Leg 1', 'Leg2'}) %?
Star Strider
Star Strider am 18 Okt. 2020

0 Stimmen

See the Line Properties documentation on DisplayName.
That might do what you want.

Tags

Gefragt:

am 18 Okt. 2020

Beantwortet:

am 18 Okt. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by