Home > NoiseTools > nt_banner.m

# nt_banner

## PURPOSE

h=nt_banner(text,varargin) - annotate with text at head of figure

## SYNOPSIS

function h=nt_banner(text)

## DESCRIPTION

    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

## CROSS-REFERENCE INFORMATION

This function calls:

This function is called by:

- nt_destep [y,stepList]=nt_destep(x,thresh,guard,depth,minstep) - remove step glitch from MEG data
- nt_find_outlier_trials [idx,d,mn,idx_unsorted]=nt_find_outlier_trials(x,criterion,plot,regress_flag) - find outlier trials

## SOURCE CODE

    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