<< rot_matrix2quaternion SIP - Scilab Image Processing Toolbox sip_fftshift >>

SIP - Scilab Image Processing Toolbox >> SIP - Scilab Image Processing Toolbox > sip_colormap

sip_colormap

creates a beautiful colormap

Calling Sequence

[map,map_number] = sip_colormap(colormap_name_or_number [,number_of_colors])

Parameters

colormap_name_or_number
can be either a string or a number
string
is one of the 19 predefined colormap names (ex 'bluered').
number
between 1 and 19.
number_of_colors
the number of rows in the colormap.

Default is 256 (8 bits).

If this number is negative, then the function will return the complimentary colormap.

Parameters

map
a colormap of size number of colors.
map_number
the number of the colormap (for quick access).

Description

sip_colormap(colormap_number,[number_of_colors]) returns one the predefined colormaps.

sip_colormap() shows the available names.

These colormaps were created by Enrico Segre and are from the ENRICO toolbox. Have a look at this toolbox if you want to improve Scilab displays.

Examples

image=imread(SIPDIR+'images/photonics/laser1.jpg');
//reads an indexed image
map=sip_colormap(10,256); //takes the colormap number 19
//it's the same as: map=sip_colormap('sunrise',256);
clf;imshow(image,map);
//display in false colors

//For 3D plots, with the map number 16 ('prism')
xset("window",1);xset("colormap",sip_colormap(16,256));
[r,c]=size(image);
plot3d1(1:4:r,1:4:c,image(1:4:r,1:4:c))

//You can have the complimentary colormap with
comp_map=abs(1-map);
clf;imshow(image,comp_map);
//or simply:comp_map=sip_coloramp(16,-256)

//To reverse the color order:
invmap(256:-1:1,1:3)=sip_colormap(7,256);

//To display a colormap:
map1=ones(1:100)'*(256:-1:1);           
clf;imshow(map1',sip_colormap(4))   
//will display the colormap number 4 in 256 colors

Authors

See Also


<< rot_matrix2quaternion SIP - Scilab Image Processing Toolbox sip_fftshift >>