MATLAB Answers

How to move a lengend to the front with subplots

29 views (last 30 days)
Al
Al on 16 Aug 2015
Edited: Al on 16 Aug 2015
Hi have a figure with two subplots. The data for the legend comes from the top subplot. There is some empty space on the bottom subplot. When I drag the legend to the bottom subplot is disappears behind the plot.
I tried
I=legend({'$100 \hspace mm^{2}$'},'Location','southwest')
set(I, 'Interpreter', 'latex','Visible', 'on')
uistack(I,'up',200)
no joy

  2 Comments

Walter Roberson
Walter Roberson on 16 Aug 2015
Are you using R2014b or later, or R2014a or earlier? legend() is implemented differently as of R2014b .
Did you try
uistack(I,'top')
Al
Al on 16 Aug 2015
Thanks. I tried
uistack(I,'top')
however the legend is still behind the lower sub plot. I am using 2015a.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!