Home > NoiseTools > nt_same_clim.m

# nt_same_clim

## PURPOSE

nt_same_clim(h) - harmonize color limits of plots within figure

## SYNOPSIS

function nt_same_clim(h)

## DESCRIPTION

    nt_same_clim(h) - harmonize color limits of plots within figure

      h: figure handle [default: current]

## CROSS-REFERENCE INFORMATION

This function calls:

This function is called by:

## SOURCE CODE

    0001 function nt_same_clim(h)
    0002 %nt_same_clim(h) - harmonize color limits of plots within figure
    0003 %
    0004 %  h: figure handle [default: current]
    0005
    0006 if nargin<1; h=gcf; end
    0007
    0008 c=get(h,'children');
    0009 clims=[];
    0010 for iC=1:numel(c)
    0011     cc=c(iC);
    0012     try
    0013         if ~isempty(get(cc,'clim'));
    0014             clims=[clims; (get(cc,'clim'))];
    0015         end
    0016     end
    0017 end
    0018 for iC=1:numel(c)
    0019     cc=c(iC);
    0020     try
    0021         set(cc,'clim',[min(clims(:)),max(clims(:))]);
    0022     end
    0023 end
    0024
    0025
    0026