Location of legend on tiledlayout does not match with the plot
2 次查看(过去 30 天)
显示 更早的评论
Hello,
I have a tiledlayout and I want to locate my legend outside south and in a box off format. However whatever I do, it is always located on the right corner. How can I fix it?
leg = legend('18', '19', '21');
leg.Location="southoutside";
leg.Orientation="horizontal";
legend boxoff
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1444632/image.png)
Thank you in advance for your time.
0 个评论
采纳的回答
Voss
2023-7-28
% some plots
t = tiledlayout(3,3);
for i = 1:9
nexttile(t)
plot(rand(10,3));
end
% make the legend
leg = legend('18', '19', '21');
leg.Layout.Tile = 'south';
leg.Orientation="horizontal";
legend boxoff
更多回答(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!