h=nt_banner(text,varargin) - annotate with text at head of figure h: handle to annotation text: string to print default horizontal position is 'center' NoiseTools
0001 function h=nt_banner(text) 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 % 0008 % default horizontal position is 'center' 0009 % 0010 % NoiseTools 0011 0012 c=get(gcf,'children'); 0013 y=0; 0014 0015 % find the top of uppermost subplot 0016 for k=1:numel(c) 0017 pos=get(c(k),'position'); 0018 y=max(y,pos(2)+pos(4)); 0019 end 0020 0021 h=annotation('textbox',[0 y 1 1-y], 'linestyle', 'none', 'string', ... 0022 text, 'interpreter', 'none', 'verticalalignment', 'top', 'horizontalalignment', 'center'); 0023 0024 if nargout==0; clear h; end 0025