position of legend contour plot

4 views (last 30 days)
I have a contour plot obtained via the function "contour", and it places the legend inside the figure. For regular plots there is this additional option to specify the location of the legend, however it does not seem to exist for the contour function. Is there anyway I can move it outside of the figure?

Accepted Answer

Star Strider
Star Strider on 7 Mar 2015
Edited: Star Strider on 7 Mar 2015
Use one of the ‘...outside’ 'Location' options:
M = magic(10);
figure(1)
contour(M)
legend('Data','Location','northeastoutside')
  2 Comments
Michiel
Michiel on 7 Mar 2015
so much simpler than I thought
Star Strider
Star Strider on 7 Mar 2015
There are version differences, so the exact syntax can vary. This works with R2014b.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!