function setmap(n) %SETMAP Set the image colormap. % % SETMAP(COLORMAP) % % COLORMAP is a number between 1 and 20 as on the Nanoscope % or a new colormap. % % Claudio 25 Jan, 1995. % % % Copyright (c) 1995 by Claudio Rivetti and Mark Young % claudio@alice.uoregon.edu, mark@alice.uoregon.edu % global map Extramap Undofun ed_colormap global cmap if prod(size(n)) == 1 map=cmap{n}; setclipboard(getmap); Undofun='setmap(getclipboard);'; set(ed_colormap, 'value', n, 'string', num2str(n)); else premap=map; map=n; cmap{getmap}=map; Undofun='setmap(getclipboard);'; setclipboard(premap); end ap=mapcontrast(map, getcontrast); ap=mapoffset(ap, getoffset); colormap(ap); return