Evgeni Sergeev
Evgeni Sergeev

Reputation: 23593

How to display legend in bottom right corner instead of top right?

Normally the legend appears in the top-right corner when using the command

legend('aa', 'bb', 'cc', 'dd')

But that blocks my curves.

How to place it in the bottom-right corner instead?

Upvotes: 7

Views: 30485

Answers (1)

Evgeni Sergeev
Evgeni Sergeev

Reputation: 23593

It's simple:

legend('aa', 'bb', 'cc', 'dd', 'Location','SouthEast');

How then does it distinguish between labels and arguments? It doesn't. So if you say

legend('aa', 'bb', 'cc', 'dd', 'Location');

it will throw an error. So, if "Location" is one of your labels, use

legend({'aa', 'bb', 'cc', 'dd', 'Location'});

Upvotes: 12

Related Questions