[繪圖] 怎麼改變subplot中legend的orientation

看板MATLAB作者 (^^￾N )時間12年前 (2013/08/25 01:37), 編輯推噓0(002)
留言2則, 1人參與, 最新討論串1/1
我想要畫包含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

08/25 02:26, , 1F
原來horizontal要加引號 好笨 但是一旦調整圖框大小
08/25 02:26, 1F

08/25 02:26, , 2F
legend高度會變大耶 怎麼會這樣
08/25 02:26, 2F
文章代碼(AID): #1I6EzgMH (MATLAB)