h=nt_banner(text,varargin) - annotate with text at head of figure h: handle to annotation text: string to print varargin: arguments to pass to annotation() default horizontal position is 'center' NoiseTools
0001 function h=nt_banner(text,varargin) 0002 %h=nt_banner(text,varargin) - annotate with text at head of figure 0003 % 0004 % h: handle to annotation 0005 % 0006 % text: string to print 0007 % varargin: arguments to pass to annotation() 0008 % 0009 % default horizontal position is 'center' 0010 % 0011 % NoiseTools 0012 0013 set(gcf,'numbertitle','off','name',text); 0014 0015 0016 % 0017 % c=get(gcf,'children'); 0018 % % find the top of uppermost subplot 0019 % y=0; 0020 % for k=1:numel(c) 0021 % pos=get(c(k),'position'); 0022 % y=max(y,pos(2)+pos(4)); 0023 % end 0024 % 0025 % h=annotation('textbox',[0 y 1 1-y], 'linestyle', 'none', 'string', ... 0026 % text, 'interpreter', 'none', 'verticalalignment', 'top', 'horizontalalignment', 'center', varargin{:}); 0027 % 0028 % if nargout==0; clear h; end 0029 %