The example below creates a legend in a figure and attempts to resize the legend.
plot(1:10)L=legend('text');set(L,'FontSize',8);a1=get(L,'Position')set(L,'Position',[0.6 0.6 0.1 0.02]);b1=get(L,'Position')set(L,'Position',[0.6 0.6 0.1 0.02]);%
c1=get(L,'Position')
The variables a1, b1, and c1 describe the position of the legend:
a1 – before resizing the legend
b1 – after resizing once
c1 – after resizing a second time.
Notice that only the second attempt to resize the legend is successful.
Best Answer