- 在线时间
- 36 小时
- 最后登录
- 2017-7-6
- 注册时间
- 2009-4-19
- 听众数
- 5
- 收听数
- 1
- 能力
- 0 分
- 体力
- 2412 点
- 威望
- 98 点
- 阅读权限
- 60
- 积分
- 1865
- 相册
- 0
- 日志
- 1
- 记录
- 1
- 帖子
- 316
- 主题
- 28
- 精华
- 0
- 分享
- 0
- 好友
- 24
TA的每日心情 | 开心 2014-9-21 08:29 |
---|
签到天数: 19 天 [LV.4]偶尔看看III - 自我介绍
- 我思我在
群组: 数学建模 群组: 中国矿业大学数学建模协会 群组: 数学趣味、游戏、IQ等 群组: 南京邮电大学数模协会 群组: LINGO |
function mmline(arg1,arg2,arg3,arg4,arg5,arg6)
%MMLINE Set Line Properties Using Mouse.
% MMLINE waits for a mouse click on a line then
% applies the desired properties to the selected line.
% Properties are given in pairs, e.g., MMLINE name value ...
% Properties:
% NAME VALUE {default}
% color [y m c r g b w k] or an rgb in quotes: '[r g b]'
% style [- -- : -.]
% mark [o + . * x)]
% width points for linewidth {0.5}
% size points for marker size (6)
% zap (n.a.) delete selected line
% Examples:
% MMLINE color r width 2 sets color to red and width to 2 points
% MMLINE mark + size 8 sets marker type to + and size to 8 points
% MMLINE color '[1 .5 0]' sets color to orange
%
% Clicking on an object other than a line, or striking
% a key on the keyboard aborts the command.
% D.C. Hanselman, University of Maine, Orono, ME, 04469
% 4/27/95
% Copyright (c) 1996 by Prentice-Hall, Inc.
Hf=mmgcf;
if isempty(Hf), error('No Figure Available.'), end
if length(get(0,'Children'))==1
figure(Hf) % bring only figure forward
end
key=waitforbuttonpress;
if key % key on keyboard pressed
return
else % object selected
Hl=gco;
if strcmp(get(Hl,'Type'),'line') % line object selected
for i=1:2:max(nargin-1,1)
name=eval(sprintf('arg%.0f',i),'[]'); % get name argument
if strcmp(name,'zap')
delete(Hl),return
end
value=eval(sprintf('arg%.0f',i+1),'[]'); % get value argument
if strcmp(name,'color')
if value(1)=='[',value=eval(value);end
set(Hl,'Color',value)
elseif strcmp(name,'style')
set(Hl,'Linestyle',value)
elseif strcmp(name,'mark')
set(Hl,'Linestyle',value)
elseif strcmp(name,'width')
value=abs(eval(value));
set(Hl,'LineWidth',value)
elseif strcmp(name,'size')
value=abs(eval(value));
set(Hl,'MarkerSize',value)
else
disp(['Unknown Property Name: ' name])
end
end
end
end |
|