Home > FMAToolbox > Plot > PlotShortTimeCCG.m

PlotShortTimeCCG

PURPOSE ^

PlotShortTimeCCG - Plot time-varying auto/cross-correlograms of point processes.

SYNOPSIS ^

function PlotShortTimeCCG(data,varargin)

DESCRIPTION ^

PlotShortTimeCCG - Plot time-varying auto/cross-correlograms of point processes.

  USAGE

    PlotShortTimeCCG(data,<options1>,<options2>)

    data           data obtained using <a href="matlab:help ShortTimeCCG">ShortTimeCCG</a>
    <options1>     optional list of property-value pairs (see table below)
    <options2>     optional list of property-value pairs (see <a href="matlab:help PlotColorMap">PlotColorMap</a>)

    =========================================================================
     Properties    Values
    -------------------------------------------------------------------------
     'parent'      parent figure or uipanel handle (default = gcf)
    =========================================================================

  SEE

    See also CCG, ShortTimeCCG.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function PlotShortTimeCCG(data,varargin)
0002 
0003 %PlotShortTimeCCG - Plot time-varying auto/cross-correlograms of point processes.
0004 %
0005 %  USAGE
0006 %
0007 %    PlotShortTimeCCG(data,<options1>,<options2>)
0008 %
0009 %    data           data obtained using <a href="matlab:help ShortTimeCCG">ShortTimeCCG</a>
0010 %    <options1>     optional list of property-value pairs (see table below)
0011 %    <options2>     optional list of property-value pairs (see <a href="matlab:help PlotColorMap">PlotColorMap</a>)
0012 %
0013 %    =========================================================================
0014 %     Properties    Values
0015 %    -------------------------------------------------------------------------
0016 %     'parent'      parent figure or uipanel handle (default = gcf)
0017 %    =========================================================================
0018 %
0019 %  SEE
0020 %
0021 %    See also CCG, ShortTimeCCG.
0022 
0023 % Copyright (C) 2010-2011 by Michaƫl Zugaro
0024 %
0025 % This program is free software; you can redistribute it and/or modify
0026 % it under the terms of the GNU General Public License as published by
0027 % the Free Software Foundation; either version 3 of the License, or
0028 % (at your option) any later version.
0029 
0030 % Default values
0031 parent = [];
0032 x = 1:size(data,2);
0033 y = 1:size(data,1);
0034 args = {};
0035 
0036 if nargin < 1,
0037     error('Incorrect number of parameters (type ''help <a href="matlab:help PlotShortTimeCCG">PlotShortTimeCCG</a>'' for details).');
0038 end
0039 
0040 % Parse parameter list
0041 j = 1;
0042 for i = 1:2:length(varargin),
0043     if ~ischar(varargin{i}),
0044         error(['Parameter ' num2str(i+2) ' is not a property (type ''help <a href="matlab:help PlotShortTimeCCG">PlotShortTimeCCG</a>'' for details).']);
0045     end
0046     switch(lower(varargin{i})),
0047 
0048         case 'parent',
0049             parent = varargin{i+1};
0050             if ~ishandle(parent),
0051                 error('Incorrect value for property ''parent'' (type ''help <a href="matlab:help PlotShortTimeCCG">PlotShortTimeCCG</a>'' for details).');
0052             end
0053 
0054         case 'x',
0055             x = varargin{i+1};
0056             if ~isdvector(x),
0057                 error('Incorrect value for property ''x'' (type ''help <a href="matlab:help PlotShortTimeCCG">PlotShortTimeCCG</a>'' for details).');
0058             end
0059             args{j} = varargin{i};
0060             args{j+1} = varargin{i+1};
0061             j = j + 2;
0062 
0063         case 'y',
0064             y = varargin{i+1};
0065             if ~isdvector(y),
0066                 error('Incorrect value for property ''y'' (type ''help <a href="matlab:help PlotShortTimeCCG">PlotShortTimeCCG</a>'' for details).');
0067             end
0068             args{j} = varargin{i};
0069             args{j+1} = varargin{i+1};
0070             j = j + 2;
0071 
0072         case {'threshold','cutoffs','gamma','colorspace','bar','type'},
0073             args{j} = varargin{i};
0074             args{j+1} = varargin{i+1};
0075             j = j + 2;
0076 
0077         otherwise,
0078             error(['Unknown property ''' num2str(varargin{i}) ''' (type ''help <a href="matlab:help PlotShortTimeCCG">PlotShortTimeCCG</a>'' for details).']);
0079 
0080     end
0081 end
0082 
0083 if isempty(parent), parent = gcf; end
0084 
0085 xcorrs = round(linspace(1,size(data,2),5));
0086 for i = 1:5,
0087     subplot(5,6,6*i,'parent',parent);
0088     j = round(xcorrs(i));
0089     bar(y,data(:,j));
0090     xlim([min(y) max(y)]);
0091     xlabel(['t = ' num2str(x(j))]);
0092     set(gca,'ytick',[]);
0093 end
0094 subplot(5,6,[1 29],'parent',parent);
0095 PlotColorMap(data,1,args{:});
0096 xlabel('Time (s)');
0097 ylabel('Time shift (s)');
0098

Generated on Fri 16-Mar-2018 13:00:20 by m2html © 2005