curvplot.m

来自「改进等高线拟合代码」· M 代码 · 共 77 行

M
77
字号
function curvplot(x,y,style)

% CURVPLOT Handles the cuvature plot in GUI.
% usage: curvplot(x,y,style), x = arclength, y= curvature.

% All the software included in this package is presented as is.
% It may be distributed freely. The author can, however, not be
% held responsible for any problems whatever.
% 
% Designed by Johan Baeten
% Last updated: 29-03-2000
% Johan.baeten@mech.kuleuven.ac.be



[existFlag,fignr]=figflag('GUI Curvature Profile Window',1);

if ~existFlag,
   % create print window now %
   %%%%%%%%%%%%%%%%%%%%%%%%%%%
   position=get(0,'DefaultFigurePosition');
   fignr=figure( ...
         'Name','GUI Curvature Profile Window', ...
         'NumberTitle','off', ...
         'Visible','off', ...
         'MenuBar','none', ...
 	 	   'Position',position, ...
 	 	   'color',[1,1,1],...
   		'Resize','off');
   
   uicontrol(fignr,'style','frame',...
                   'backgroundcolor',[0.8 0.8 0.8],...
                   'units','normalized',...
                   'position',[0.05 0.05 0.9 0.1]);

   uicontrol(fignr,'style','pushbutton',...
                   'horizontalalignment','center',...
                   'string','Clear',...
                   'units','normalized',...                   
                   'position',[0.13 0.07 0.15 0.06],...
                   'callback','delete(findobj(gca,''type'',''line''));hold off; grid off');

   uicontrol(fignr,'style','pushbutton',...
                   'horizontalalignment','center',...
                   'string','Grid',...
                   'units','normalized',...                   
                   'position',[0.33 0.07 0.15 0.06],...
                   'callback','grid');

   uicontrol(fignr,'style','pushbutton',...
                   'horizontalalignment','center',...
                   'string','Hold on',...
                   'units','normalized',...                   
                   'position',[0.52 0.07 0.15 0.06],...
                   'callback','hold on');

   uicontrol(fignr,'style','pushbutton',...
                   'horizontalalignment','center',...
                   'string','Hide',...
                   'units','normalized',...                   
                   'position',[0.72 0.07 0.15 0.06],...
                   'callback','set(gcf,''visible'',''off'')');
                   
   %%%%%% dummy   
   h_assen = axes('position',[0.15 0.25 0.8 0.65]); 
   set(h_assen, 'box', 'on');

end


figure(fignr);
set(fignr,'visible','on');
plot(x,y,style);
title('Curvature versus Arclength')
xlabel('Arclength [pix]')
ylabel('Curvature [1/pix]')

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?