Home > chronux > spectral_analysis > plots > plotsig.m

# plotsig

## PURPOSE

Function to plot C where it is higher than a threshold sig

## SYNOPSIS

function plotsig(C,sig,t,f,c)

## DESCRIPTION

``` Function to plot C where it is higher than a threshold sig
useful for plotting coherence
Usage: plotsig(C,sig,t,f)
Inputs:
C: input array t x f - also works for a single vector
sig: significance level
t: t axis grid for plot
f: f axis grid for plot.
c: color to use (default blue)-only meaningful for a line plot```

## CROSS-REFERENCE INFORMATION

This function calls:
This function is called by:

## SOURCE CODE

```0001 function plotsig(C,sig,t,f,c)
0002 % Function to plot C where it is higher than a threshold sig
0003 % useful for plotting coherence
0004 % Usage: plotsig(C,sig,t,f)
0005 % Inputs:
0006 % C: input array t x f - also works for a single vector
0007 % sig: significance level
0008 % t: t axis grid for plot
0009 % f: f axis grid for plot.
0010 % c: color to use (default blue)-only meaningful for a line plot
0011 if nargin < 4; error('Need at least 4 arguments'); end;
0012 if nargin < 5 | isempty(c); c='b'; end;
0013 [T,F]=size(C);
0014 if F==1; C=C'; [T,F]=size(C);end;
0015 if T~=length(t) | F~=length(f);
0016     error('frequency and/or time axes are incompatible with data');
0017 end;
0018 if T==1;
0019     dim=max(T,F);
0020     C=C(:);
0021     indx=find(C>sig);
0022     plot(f,C,c);
0024     line(get(gca,'xlim'),[sig sig]);
0025     xlabel('f'); ylabel('|C|');
0026 else