Daniel@0: function h = uimagesc(varargin) Daniel@0: %UIMAGESC Display scaled image with uneven axis. Daniel@0: % UIMAGESC(...) is the same as UIMAGE(...) except the data is scaled Daniel@0: % to use the full colormap. See UIMAGE for details. Daniel@0: % Daniel@0: % Note: UIMAGESC is based on Matlab's original IMAGESC, Revision 5.11.4.5. Daniel@0: % UIMAGESC simply calls UIMAGE with a scaled colormap. Daniel@0: % Daniel@0: % F. Moisy - adapted from TMW Daniel@0: % Revision: 1.01, Date: 2006/06/13. Daniel@0: % Daniel@0: % See also IMAGE, IMAGESC, UIMAGE. Daniel@0: Daniel@0: % History: Daniel@0: % 2006/06/12: v1.00, first version. Daniel@0: Daniel@0: clim = []; Daniel@0: switch (nargin), Daniel@0: case 0, Daniel@0: hh = uimage('CDataMapping','scaled'); Daniel@0: case 1, Daniel@0: hh = uimage(varargin{1},'CDataMapping','scaled'); Daniel@0: case 3, Daniel@0: hh = uimage(varargin{:},'CDataMapping','scaled'); Daniel@0: otherwise, Daniel@0: Daniel@0: % Determine if last input is clim Daniel@0: if isequal(size(varargin{end}),[1 2]) Daniel@0: str = false(length(varargin),1); Daniel@0: for n=1:length(varargin) Daniel@0: str(n) = ischar(varargin{n}); Daniel@0: end Daniel@0: str = find(str); Daniel@0: if isempty(str) || (rem(length(varargin)-min(str),2)==0), Daniel@0: clim = varargin{end}; Daniel@0: varargin(end) = []; % Remove last cell Daniel@0: else Daniel@0: clim = []; Daniel@0: end Daniel@0: else Daniel@0: clim = []; Daniel@0: end Daniel@0: hh = uimage(varargin{:},'CDataMapping','scaled'); Daniel@0: end Daniel@0: Daniel@0: % Get the parent Axes of the image Daniel@0: cax = ancestor(hh,'axes'); Daniel@0: Daniel@0: if ~isempty(clim), Daniel@0: set(cax,'CLim',clim) Daniel@0: elseif ~ishold(cax), Daniel@0: set(cax,'CLimMode','auto') Daniel@0: end Daniel@0: Daniel@0: if nargout > 0 Daniel@0: h = hh; Daniel@0: end