Home > bioelectromagnetism > ColorMapsShow.m

ColorMapsShow

PURPOSE ^

colorMapsShow - display/select available Matlab colormaps

SYNOPSIS ^

function [cmap] = ColorMapsShow

DESCRIPTION ^

 colorMapsShow - display/select available Matlab colormaps

 Example:  figure, colormap(ColorMapsShow), colorbar

 See also colorMapsMake, colorbar

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [cmap] = ColorMapsShow
0002 
0003 % colorMapsShow - display/select available Matlab colormaps
0004 %
0005 % Example:  figure, colormap(ColorMapsShow), colorbar
0006 %
0007 % See also colorMapsMake, colorbar
0008 %
0009 
0010 % $Revision: 1.1 $ $Date: 2004/11/12 01:30:24 $
0011 
0012 % Licence:  GNU GPL, no implied or express warranties
0013 % History:  01/99 Uilke Stelwagen, Copyright (C) 1992-1999
0014 %           Institute of Applied Physics, TNO-TPD, The Netherlands.
0015 %           09/01 Darren.Weber_at_radiology.ucsf.edu
0016 %                 - downloaded function from the mathworks, distrib.
0017 %                   under GPL
0018 %                 - adapted function to gui selection of colormap
0019 %                   and return of a prefered map in cmap
0020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0021 
0022 maps = [
0023    'hsv        - hue-saturation-value           '
0024    'hot        - black-red-yellow-white         '
0025    'gray       - linear gray-scale              '
0026    'bone       - gray-scale with blue tinge     '
0027    'copper     - linear copper-tone             '
0028    'pink       - pastel pinks                   '
0029    'white      - all white                      '
0030    'flag       - red, white, blue, & black      '
0031    'lines      - color map of the line colors   '
0032    'colorcube  - enhanced color-cube            '
0033    'jet        - variant HSV (Matlab default)   '
0034    'prism      - prism                          '
0035    'cool       - cyan and magenta               '
0036    'autumn     - red and yellow                 '
0037    'spring     - magenta and yellow             '
0038    'winter     - blue and green                 '
0039    'summer     - green and yellow               '
0040 ];
0041 
0042 [map,ok] = listdlg('PromptString','Double-Click ColorMap',...
0043                    'SelectionMode','single',...
0044                    'ListString',maps,...
0045                    'CancelString','Done',...
0046                    'uh',30,'fus',5,'ffs',5,...
0047                    'ListSize',[200 330]);
0048 
0049 figure('menubar','none','NumberTitle','off',...
0050        'NextPlot','replace');
0051 
0052 h = subplot(143);
0053 colorbar(h);
0054 
0055 while ok
0056     
0057     colormap(deblank(maps(map,1:10)));
0058     %title(   deblank(maps(map,:)));
0059     
0060     [map,ok] = listdlg('PromptString','Double-Click ColorMap',...
0061                        'SelectionMode','single',...
0062                        'InitialValue',map,...
0063                        'ListString',maps,...
0064                        'CancelString','Done',...
0065                        'uh',30,'fus',5,'ffs',5,...
0066                        'ListSize',[200 330]);
0067                    
0068 end
0069 cmap = colormap;
0070 close gcf

Generated on Mon 15-Aug-2005 15:36:19 by m2html © 2003