-
Notifications
You must be signed in to change notification settings - Fork 4
/
hotCD.m
43 lines (40 loc) · 1.26 KB
/
hotCD.m
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
% col = hotCD(num,hue)
%
% hotCD returns single-hue colormaps, the default is red
%
% can take in an argument to adjust for hues
% 'r': red
% 'y': yellow
% 'g': green
% 'c': cyan
% 'b': blue
% 'm': magenta
% 'gry': gray
%
% Last update: 2018-08-14
function col = hotCD(num,hue)
% *********************************************************************
% Parse input arguments
% *********************************************************************
if ~exist('num','var') num = 12; end
if ~exist('hue','var') hue = 'r'; end
% *********************************************************************
% Generate colormap
% *********************************************************************
switch hue,
case 'r',
col = colormap_CD([0.1 0.95],[1 .35],[0],num);
case 'y',
col = colormap_CD([1/6 0.1],[1 .2],[0],num);
case 'g',
col = colormap_CD([0.3 0.45],[1 .2],[0],num);
case 'c',
col = colormap_CD([0.52 0.48],[1 .2],[0],num);
case 'b',
col = colormap_CD([0.5 0.65],[1 .25],[0],num);
case 'm',
col = colormap_CD([1 0.8],[1 .2],[0],num);
case 'gry',
col = colormap_CD([1 0.8],[1 .2],[1],num);
end
end