作者cinna (^^N )
看板MATLAB
标题[绘图] 怎麽改变subplot中legend的orientation
时间Sun Aug 25 01:37:44 2013
我想要画包含6个subplot直条图的图
排列方式为[3 2]
因为A4纸的宽度限制
leged想要放在这六张图的最下方
并且是水平排列的
今天Google了好久终於找到一个方法可以控制legend的位置
% Construct a Legend with the data from the sub-plots
hL = legend({'1st Ranked','2nd Ranked','3rd Ranked','4th Ranked','5th
Ranked'});
% Programatically move the Legend
newPosition = [0.2 0.0 0.475 0.1];
newUnits = 'normalized';
set(hL,'Position',newPosition,'Units', newUnits);
legend('boxoff');
但是legend 的orientation预设为垂直
要怎麽改才能让orientation变为horizontal呢?
新手发问 请问怎麽解决呢 谢谢!
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 114.45.227.216
1F:→ cinna:原来horizontal要加引号 好笨 但是一旦调整图框大小 08/25 02:26
2F:→ cinna:legend高度会变大耶 怎麽会这样 08/25 02:26