我是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');
新手上路 搞不太清楚問題出在哪裡 麻煩版上先進指點 非常感謝!