我是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');
新手上路 搞不太清楚问题出在哪里 麻烦版上先进指点 非常感谢!