Increase outer position width while keep inner position unchanged
8 次查看(过去 30 天)
显示 更早的评论
How can I make a matlab figure wider so I can place legends (there're 11) outside drawing box so legends do not block plots? Specifically, make the right gray area wider and keep everything else unchanged.
0 个评论
采纳的回答
Star Strider
2021-12-18
I am not absolutely certain what the desired result is, however here is an illustration (although the online Run feature is not the best place to demonstrate it, since the plot areas are constricted, so experiment offline to get the best results) —
x = 1:0.1:10;
y = randn(size(x));
figure
plot(x,y)
grid
legend('y', 'Location','eastoutside')
title('Original')
figure
plot(x,y)
grid
legend('y', 'Location','eastoutside')
title('Repositioning Width')
% Fg = gcf;
% fpos = Fg.Position
% Fg.Position = fpos + [0 0 -50 0];
Ax = gca;
aipos = Ax.InnerPosition
Ax.InnerPosition = aipos + [0 0 -0.1 0];
aopos = Ax.OuterPosition
Ax.OuterPosition = aopos + [0 0 0.3 0];
.
2 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Legend 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

