How to move a lengend to the front with subplots

16 views (last 30 days)
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
  3 Comments
Al
Al on 16 Aug 2015
Edited: 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.
Zong-Jhen Ye
Zong-Jhen Ye on 11 May 2022
Hi, I have the same problem and I use the following method to solve it:
figure()
subplot(2,2,2)...
subplot(2,2,3)...
subplot(2,2,4)...
subplot(2,1,1)...
legend('Put what you want here')

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!