📄 draw.m
字号:
function fig = draw()
% 手画光滑曲线图形界面
% 先用Range确定大致范围;然后用ginput用鼠标单击大致数据点;最后用Draw it画图。
% 本程序采用样条拟合
% By L. J. Hu, 2000
% This is the machine-generated representation of a Handle Graphics object
% and its children. Note that handle values may change when these objects
% are re-created. This may cause problems with any callbacks written to
% depend on the value of the handle at the time the object was saved.
%
% To reopen this object, just type the name of the M-file at the MATLAB
% prompt. The M-file and its associated MAT-file must be on your path.
load draw
h0 = figure('Color',[0.8 0.8 0.8], ...
'Colormap',mat0, ...
'Name','Smooth Draw', ...
'NumberTitle','off', ...
'PointerShapeCData',mat1, ...
'Position',[40 45 560 375], ...
'Resize','off', ...
'Tag','drawfig', ...
'UserData',mat2);
h1 = axes('Parent',h0, ...
'Units','pixels', ...
'Box','on', ...
'CameraUpVector',[0 1 0], ...
'CameraUpVectorMode','manual', ...
'Color',[1 1 1], ...
'ColorOrder',mat3, ...
'HandleVisibility','callback', ...
'Position',[52 135 347 218], ...
'Tag','Axes1', ...
'XColor',[0 0 0], ...
'XGrid','on', ...
'XLimMode','manual', ...
'YColor',[0 0 0], ...
'YGrid','on', ...
'YLimMode','manual', ...
'ZColor',[0 0 0], ...
'ZGrid','on');
h2 = text('Parent',h1, ...
'Color',[0 0 0], ...
'HandleVisibility','off', ...
'HorizontalAlignment','center', ...
'Position',[0.4971098265895954 -0.1105990783410138 9.160254037844386], ...
'Tag','Axes1Text4', ...
'VerticalAlignment','cap');
set(get(h2,'Parent'),'XLabel',h2);
h2 = text('Parent',h1, ...
'Color',[0 0 0], ...
'HandleVisibility','off', ...
'HorizontalAlignment','center', ...
'Position',[-0.08959537572254335 0.4930875576036867 9.160254037844386], ...
'Rotation',90, ...
'Tag','Axes1Text3', ...
'VerticalAlignment','baseline');
set(get(h2,'Parent'),'YLabel',h2);
h2 = text('Parent',h1, ...
'Color',[0 0 0], ...
'HandleVisibility','off', ...
'HorizontalAlignment','right', ...
'Position',[-0.1502890173410405 1.101382488479263 9.160254037844386], ...
'Tag','Axes1Text2', ...
'Visible','off');
set(get(h2,'Parent'),'ZLabel',h2);
h2 = text('Parent',h1, ...
'Color',[0 0 0], ...
'HandleVisibility','off', ...
'HorizontalAlignment','center', ...
'Position',[0.4971098265895954 1.032258064516129 9.160254037844386], ...
'Tag','Axes1Text1', ...
'VerticalAlignment','bottom');
set(get(h2,'Parent'),'Title',h2);
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...
'ListboxTop',0, ...
'Position',[325.5 3 85.5 263.25], ...
'Style','frame', ...
'Tag','Frame1');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'Callback','clear;[x,y]=ginput;', ...
'FontSize',14, ...
'ListboxTop',0, ...
'Position',[333 222 72 25.5], ...
'String','Ginput', ...
'Tag','Pushbutton1');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'Callback','pp=csaps(x,y,0.9999);fnplt(pp,''b'',2);', ...
'FontSize',14, ...
'ListboxTop',0, ...
'Position',[333.75 192 72 24.75], ...
'String','Draw It', ...
'Tag','Pushbutton2');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'Callback','gline', ...
'FontSize',14, ...
'ListboxTop',0, ...
'Position',[333.75 163.5 72 24.75], ...
'String','Line', ...
'Tag','Pushbutton3');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'Callback',mat4, ...
'FontSize',14, ...
'ListboxTop',0, ...
'Position',[334.5 102 72 25.5], ...
'String','Range', ...
'Tag','Pushbutton4');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'Callback','cla;axis([0 1 0 1]);hold off', ...
'FontSize',14, ...
'ListboxTop',0, ...
'Position',[334.5 13.5 71.25 26.25], ...
'String','Erase', ...
'Tag','Pushbutton5');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'Callback','grid', ...
'FontSize',14, ...
'ListboxTop',0, ...
'Position',[334.5 133.5 72 25.5], ...
'String','Grid', ...
'Tag','Pushbutton6');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'ListboxTop',0, ...
'Position',[21.75 9 273 63.75], ...
'Style','frame', ...
'Tag','Frame2');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[1 1 1], ...
'Callback','eval(get(gcbo,''string''))', ...
'ListboxTop',0, ...
'Position',[32.25 9.75 261 46.5], ...
'Style','edit', ...
'Tag','EditText1');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'Callback',mat5, ...
'FontSize',14, ...
'ListboxTop',0, ...
'Position',[334.5 73.5 71.25 23.25], ...
'String','Labels', ...
'Tag','Pushbutton7');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...
'ListboxTop',0, ...
'Position',[27 57.75 81 12], ...
'String','Command Window', ...
'Style','text', ...
'Tag','StaticText1');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ...
'ListboxTop',0, ...
'Position',[332.25 248.25 75.75 15], ...
'String','Control Panel', ...
'Style','text', ...
'Tag','StaticText2');
h1 = uicontrol('Parent',h0, ...
'Units','points', ...
'Callback','hold', ...
'FontSize',14, ...
'ListboxTop',0, ...
'Position',[334.5 43.5 70.5 24.75], ...
'String','Hold', ...
'Tag','Pushbutton8');
if nargout > 0, fig = h0; end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -