Mercurial > hg > mauch-mirex-2010
annotate _misc/figures/.svn/text-base/uimagesc.m.svn-base @ 8:b5b38998ef3b
added all that other stuff
author | matthiasm |
---|---|
date | Fri, 11 Apr 2014 15:54:25 +0100 |
parents | |
children |
rev | line source |
---|---|
matthiasm@8 | 1 function h = uimagesc(varargin) |
matthiasm@8 | 2 %UIMAGESC Display scaled image with uneven axis. |
matthiasm@8 | 3 % UIMAGESC(...) is the same as UIMAGE(...) except the data is scaled |
matthiasm@8 | 4 % to use the full colormap. See UIMAGE for details. |
matthiasm@8 | 5 % |
matthiasm@8 | 6 % Note: UIMAGESC is based on Matlab's original IMAGESC, Revision 5.11.4.5. |
matthiasm@8 | 7 % UIMAGESC simply calls UIMAGE with a scaled colormap. |
matthiasm@8 | 8 % |
matthiasm@8 | 9 % F. Moisy - adapted from TMW |
matthiasm@8 | 10 % Revision: 1.01, Date: 2006/06/13. |
matthiasm@8 | 11 % |
matthiasm@8 | 12 % See also IMAGE, IMAGESC, UIMAGE. |
matthiasm@8 | 13 |
matthiasm@8 | 14 % History: |
matthiasm@8 | 15 % 2006/06/12: v1.00, first version. |
matthiasm@8 | 16 |
matthiasm@8 | 17 clim = []; |
matthiasm@8 | 18 switch (nargin), |
matthiasm@8 | 19 case 0, |
matthiasm@8 | 20 hh = uimage('CDataMapping','scaled'); |
matthiasm@8 | 21 case 1, |
matthiasm@8 | 22 hh = uimage(varargin{1},'CDataMapping','scaled'); |
matthiasm@8 | 23 case 3, |
matthiasm@8 | 24 hh = uimage(varargin{:},'CDataMapping','scaled'); |
matthiasm@8 | 25 otherwise, |
matthiasm@8 | 26 |
matthiasm@8 | 27 % Determine if last input is clim |
matthiasm@8 | 28 if isequal(size(varargin{end}),[1 2]) |
matthiasm@8 | 29 str = false(length(varargin),1); |
matthiasm@8 | 30 for n=1:length(varargin) |
matthiasm@8 | 31 str(n) = ischar(varargin{n}); |
matthiasm@8 | 32 end |
matthiasm@8 | 33 str = find(str); |
matthiasm@8 | 34 if isempty(str) || (rem(length(varargin)-min(str),2)==0), |
matthiasm@8 | 35 clim = varargin{end}; |
matthiasm@8 | 36 varargin(end) = []; % Remove last cell |
matthiasm@8 | 37 else |
matthiasm@8 | 38 clim = []; |
matthiasm@8 | 39 end |
matthiasm@8 | 40 else |
matthiasm@8 | 41 clim = []; |
matthiasm@8 | 42 end |
matthiasm@8 | 43 hh = uimage(varargin{:},'CDataMapping','scaled'); |
matthiasm@8 | 44 end |
matthiasm@8 | 45 |
matthiasm@8 | 46 % Get the parent Axes of the image |
matthiasm@8 | 47 cax = ancestor(hh,'axes'); |
matthiasm@8 | 48 |
matthiasm@8 | 49 if ~isempty(clim), |
matthiasm@8 | 50 set(cax,'CLim',clim) |
matthiasm@8 | 51 elseif ~ishold(cax), |
matthiasm@8 | 52 set(cax,'CLimMode','auto') |
matthiasm@8 | 53 end |
matthiasm@8 | 54 |
matthiasm@8 | 55 if nargout > 0 |
matthiasm@8 | 56 h = hh; |
matthiasm@8 | 57 end |