File: parseColormap.sci

package info (click to toggle)
scilab-plotlib 0.41-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 3,196 kB
  • sloc: xml: 3,308; makefile: 15
file content (28 lines) | stat: -rw-r--r-- 759 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function out=parseColormap(typeOfPlot,value,pptystring,ppty)


win=get('current_figure');
nc=size(win.user_data.Colormap,1);

select type(value)

case 10 //  a string
  if or(value==['jet','hsv','ocean','winter','rainbow','autumn','white','summer',...
    'spring','hot','gray','copper','cool','bone','red','green','blue','pink'])
        cmap=evstr(value+"colormap(nc)");
    else
       _error(sprintf('%s : %s is an unknown colormap name',typeOfPlot,value));
    end
case 1 // a matrix (must be a nx3 element vector)
   if size(value,2)==3
      cmap=value;
   else
       _error(sprintf('%s : %s spec must be a n x 3 matrix',typeOfPlot,ppty));
   end
else
   _error(sprintf('%s : missing %s spec',typeOfPlot,ppty));
end

out=list(ppty,cmap);

endfunction