Labfans是一个针对大学生、工程师和科研工作者的技术社区。 论坛首页 | 联系我们(Contact Us)
MATLAB爱好者论坛-LabFans.com
返回   MATLAB爱好者论坛-LabFans.com > 工程数学软件 > MATLAB论坛
MATLAB论坛 一切MATLAB相关问题在此讨论。
 
 
主题工具 显示模式
旧 2009-10-15, 22:03   #1
zxerdo
初级会员
 
注册日期: 2009-10-15
年龄: 42
帖子: 1
声望力: 0
zxerdo 正向着好的方向发展
默认 请教高手们一个关于Legend的问题

我画的图里面有一部分点或线不用给出图例,求教高手这个怎么处理;

另外,我上了“Mathworks”的网站,这是网站在处理这个问题的时候i给出的例子:
This example creates a graph of random data values and draws a line at the mean y value. The blue data line does not appear in the legend because that line object has its IconDisplayStyle property of the associated LegendEntry object set to off. See Properties for Controlling Legend Content for more information.
To execute the following code, copy it into a separate function file, save it as annotation_property_line.m, and run it from the Command Window.

function annotation_property_line
dat = rand(50,1);
hLine = plot(dat);
plotMean % Nested function draws a line at mean value
set(get(get(hLine,'Annotation'),'LegendInformation'),...
'IconDisplayStyle','off'); % Exclude line from legendlegend('mean')
function plotMean
xlimits = get(gca,'XLim');
meanValue = mean(dat);
meanLine = line([xlimits(1) xlimits(2)],...
[meanValue meanValue],'Color','k','LineStyle','-.');
end
end

我按照网站上面的步骤运行这个函数,结果图能画出来,但Legend处仍无法处理;
即出现:
“??? There is no 'Annotation' property in the 'lineseries' class”的错误提示;
请高手不吝赐教,这个问题该怎么解决,非常感谢!

http://www.mathworks.com/access/help...legend&spell=1
,这是那个算例网址的连接,如果我没写清楚地画请参照这个网页上的东西
zxerdo 当前离线   回复时引用此帖
 

主题工具
显示模式

发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码



所有时间均为北京时间。现在的时间是 20:02


Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.