声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1004|回复: 1

[图像处理] 请教高手一个关于Legend的问题

[复制链接]
发表于 2009-10-15 21:41 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

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

另外,我上了“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”的错误提示;
请高手不吝赐教,这个问题该怎么解决,非常感谢!

[url=http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/creating_plots/braliom.html&http://www.google.cn/search?hl=zh-CN&;newwindow=1&ei=i_XWSvavJJyDkAW6h7HQCA&sa=X&oi=spell&resnum=0&ct=result&cd=1&ved=0CAYQBSgA&q=controlling+legend&spell=1]http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/creating_plots/braliom.html&http://www.google.cn/search?hl=zh-CN&;newwindow=1&ei=i_XWSvavJJyDkAW6h7HQCA&sa=X&oi=spell&resnum=0&ct=result&cd=1&ved=0CAYQBSgA&q=controlling+legend&spell=1[/url]
,这是那个算例网址的连接,如果我没写清楚地画请参照这个网页上的东西

[ 本帖最后由 zxerdo 于 2009-10-15 21:45 编辑 ]
回复
分享到:

使用道具 举报

发表于 2009-10-17 01:00 | 显示全部楼层
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-22 03:54 , Processed in 0.052839 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表