[問題]legend的title問題(不是整個圖的title喔)
我是R2014b
想要打legend的title(不是整個圖的title喔) 但
使用matlab官網上範例
x = -pi:pi/20:pi;
y1 = sin(x);
y2 = cos(x);
plot(x,y1,x,y2)
l = legend('sin(x)','cos(x)');
title(l,'My Legend Title')
出現
Error using title (line 27)
Incorrect number of input arguments
Error in filename (line 6)
title(l,'My Legend Title')
使用網路上另一法
x = -pi:pi/20:pi;
y1 = sin(x);
y2 = cos(x);
plot(x,y1,x,y2)
l = legend('sin(x)','cos(x)');
v = get(l,'title');
set(v,'string','Legend Title');
出現
Error using matlab.graphics.illustration.Legend/get
There is no title property on the Legend class.
Error in filename (line 6)
v = get(l,'title');
新手上路 搞不太清楚問題出在哪裡 麻煩版上先進指點 非常感謝!
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.160.122.85
※ 文章網址: https://www.ptt.cc/bbs/MATLAB/M.1470544637.A.16A.html
※ 編輯: noisenose (1.160.122.85), 08/07/2016 13:09:48
推
08/07 14:05, , 1F
08/07 14:05, 1F
→
08/07 14:05, , 2F
08/07 14:05, 2F
→
08/07 14:05, , 3F
08/07 14:05, 3F
→
08/07 14:05, , 4F
08/07 14:05, 4F
→
08/07 14:06, , 5F
08/07 14:06, 5F
推
08/07 17:14, , 6F
08/07 17:14, 6F
推
08/07 19:54, , 7F
08/07 19:54, 7F
※ 編輯: noisenose (1.160.122.85), 08/07/2016 20:07:11
※ 編輯: noisenose (1.160.122.85), 08/07/2016 20:08:18
推
08/07 21:10, , 8F
08/07 21:10, 8F
→
08/07 21:11, , 9F
08/07 21:11, 9F
→
08/08 17:41, , 10F
08/08 17:41, 10F
→
08/09 06:53, , 11F
08/09 06:53, 11F
→
08/09 06:53, , 12F
08/09 06:53, 12F