作者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