function [cm_data]=CMRmap(m)

cm = [[0.00,0.00,0.02],
[0.01,0.01,0.03],
[0.01,0.01,0.05],
[0.02,0.02,0.06],
[0.02,0.02,0.08],
[0.03,0.03,0.09],
[0.03,0.03,0.11],
[0.04,0.04,0.13],
[0.04,0.04,0.14],
[0.05,0.05,0.16],
[0.05,0.05,0.17],
[0.06,0.06,0.19],
[0.06,0.06,0.20],
[0.07,0.07,0.22],
[0.07,0.07,0.24],
[0.08,0.08,0.25],
[0.08,0.08,0.27],
[0.08,0.08,0.28],
[0.09,0.09,0.30],
[0.09,0.09,0.31],
[0.10,0.10,0.33],
[0.10,0.10,0.35],
[0.11,0.11,0.36],
[0.11,0.11,0.38],
[0.12,0.12,0.39],
[0.12,0.12,0.41],
[0.13,0.13,0.42],
[0.13,0.13,0.44],
[0.14,0.14,0.45],
[0.14,0.14,0.47],
[0.15,0.15,0.49],
[0.15,0.15,0.50],
[0.16,0.15,0.51],
[0.16,0.15,0.52],
[0.16,0.15,0.52],
[0.17,0.15,0.53],
[0.17,0.15,0.54],
[0.18,0.15,0.55],
[0.18,0.15,0.56],
[0.19,0.15,0.56],
[0.19,0.15,0.57],
[0.20,0.15,0.58],
[0.20,0.15,0.59],
[0.21,0.15,0.60],
[0.21,0.15,0.60],
[0.22,0.15,0.61],
[0.22,0.15,0.62],
[0.23,0.15,0.63],
[0.23,0.15,0.63],
[0.24,0.15,0.64],
[0.24,0.15,0.65],
[0.24,0.15,0.66],
[0.25,0.15,0.67],
[0.25,0.15,0.67],
[0.26,0.15,0.68],
[0.26,0.15,0.69],
[0.27,0.15,0.70],
[0.27,0.15,0.70],
[0.28,0.15,0.71],
[0.28,0.15,0.72],
[0.29,0.15,0.73],
[0.29,0.15,0.74],
[0.30,0.15,0.74],
[0.30,0.15,0.75],
[0.31,0.15,0.74],
[0.32,0.15,0.73],
[0.33,0.16,0.72],
[0.34,0.16,0.72],
[0.35,0.16,0.71],
[0.36,0.16,0.70],
[0.37,0.16,0.69],
[0.38,0.16,0.69],
[0.39,0.16,0.68],
[0.40,0.17,0.67],
[0.41,0.17,0.66],
[0.42,0.17,0.65],
[0.42,0.17,0.65],
[0.43,0.17,0.64],
[0.44,0.17,0.63],
[0.45,0.18,0.62],
[0.46,0.18,0.61],
[0.47,0.18,0.61],
[0.48,0.18,0.60],
[0.49,0.18,0.59],
[0.50,0.18,0.58],
[0.51,0.18,0.58],
[0.52,0.19,0.57],
[0.53,0.19,0.56],
[0.54,0.19,0.55],
[0.55,0.19,0.54],
[0.56,0.19,0.54],
[0.57,0.19,0.53],
[0.58,0.20,0.52],
[0.58,0.20,0.51],
[0.59,0.20,0.50],
[0.60,0.20,0.50],
[0.62,0.20,0.48],
[0.63,0.20,0.47],
[0.64,0.21,0.46],
[0.65,0.21,0.45],
[0.67,0.21,0.44],
[0.68,0.21,0.43],
[0.69,0.21,0.42],
[0.71,0.21,0.41],
[0.72,0.21,0.40],
[0.73,0.22,0.39],
[0.74,0.22,0.38],
[0.76,0.22,0.36],
[0.77,0.22,0.35],
[0.78,0.22,0.34],
[0.79,0.22,0.33],
[0.81,0.23,0.32],
[0.82,0.23,0.31],
[0.83,0.23,0.30],
[0.84,0.23,0.29],
[0.86,0.23,0.28],
[0.87,0.23,0.27],
[0.88,0.24,0.25],
[0.89,0.24,0.24],
[0.91,0.24,0.23],
[0.92,0.24,0.22],
[0.93,0.24,0.21],
[0.94,0.24,0.20],
[0.96,0.24,0.19],
[0.97,0.25,0.18],
[0.98,0.25,0.17],
[0.99,0.25,0.16],
[1.00,0.25,0.15],
[1.00,0.26,0.14],
[0.99,0.27,0.14],
[0.99,0.28,0.13],
[0.99,0.29,0.13],
[0.98,0.29,0.12],
[0.98,0.30,0.12],
[0.98,0.31,0.11],
[0.97,0.32,0.11],
[0.97,0.32,0.11],
[0.97,0.33,0.10],
[0.96,0.34,0.10],
[0.96,0.35,0.09],
[0.96,0.36,0.09],
[0.95,0.36,0.08],
[0.95,0.37,0.08],
[0.95,0.38,0.07],
[0.95,0.39,0.07],
[0.94,0.40,0.06],
[0.94,0.40,0.06],
[0.94,0.41,0.05],
[0.93,0.42,0.05],
[0.93,0.43,0.04],
[0.93,0.43,0.04],
[0.92,0.44,0.03],
[0.92,0.45,0.03],
[0.92,0.46,0.03],
[0.91,0.47,0.02],
[0.91,0.47,0.02],
[0.91,0.48,0.01],
[0.90,0.49,0.01],
[0.90,0.50,0.00],
[0.90,0.50,0.00],
[0.90,0.51,0.01],
[0.90,0.52,0.01],
[0.90,0.53,0.01],
[0.90,0.54,0.01],
[0.90,0.54,0.02],
[0.90,0.55,0.02],
[0.90,0.56,0.02],
[0.90,0.57,0.03],
[0.90,0.58,0.03],
[0.90,0.58,0.03],
[0.90,0.59,0.04],
[0.90,0.60,0.04],
[0.90,0.61,0.04],
[0.90,0.61,0.05],
[0.90,0.62,0.05],
[0.90,0.63,0.05],
[0.90,0.64,0.06],
[0.90,0.65,0.06],
[0.90,0.65,0.06],
[0.90,0.66,0.06],
[0.90,0.67,0.07],
[0.90,0.68,0.07],
[0.90,0.69,0.07],
[0.90,0.69,0.08],
[0.90,0.70,0.08],
[0.90,0.71,0.08],
[0.90,0.72,0.09],
[0.90,0.72,0.09],
[0.90,0.73,0.09],
[0.90,0.74,0.10],
[0.90,0.75,0.10],
[0.90,0.75,0.11],
[0.90,0.76,0.12],
[0.90,0.76,0.13],
[0.90,0.77,0.15],
[0.90,0.77,0.16],
[0.90,0.78,0.17],
[0.90,0.78,0.18],
[0.90,0.79,0.20],
[0.90,0.79,0.21],
[0.90,0.80,0.22],
[0.90,0.80,0.23],
[0.90,0.81,0.25],
[0.90,0.81,0.26],
[0.90,0.81,0.27],
[0.90,0.82,0.29],
[0.90,0.82,0.30],
[0.90,0.83,0.31],
[0.90,0.83,0.32],
[0.90,0.84,0.34],
[0.90,0.84,0.35],
[0.90,0.85,0.36],
[0.90,0.85,0.37],
[0.90,0.86,0.39],
[0.90,0.86,0.40],
[0.90,0.87,0.41],
[0.90,0.87,0.42],
[0.90,0.88,0.44],
[0.90,0.88,0.45],
[0.90,0.89,0.46],
[0.90,0.89,0.47],
[0.90,0.89,0.49],
[0.90,0.90,0.50],
[0.90,0.90,0.51],
[0.91,0.91,0.53],
[0.91,0.91,0.55],
[0.91,0.91,0.56],
[0.92,0.92,0.58],
[0.92,0.92,0.59],
[0.92,0.92,0.61],
[0.92,0.92,0.62],
[0.93,0.93,0.64],
[0.93,0.93,0.65],
[0.93,0.93,0.67],
[0.94,0.94,0.69],
[0.94,0.94,0.70],
[0.94,0.94,0.72],
[0.95,0.95,0.73],
[0.95,0.95,0.75],
[0.95,0.95,0.76],
[0.96,0.96,0.78],
[0.96,0.96,0.80],
[0.96,0.96,0.81],
[0.97,0.97,0.83],
[0.97,0.97,0.84],
[0.97,0.97,0.86],
[0.97,0.97,0.87],
[0.98,0.98,0.89],
[0.98,0.98,0.91],
[0.98,0.98,0.92],
[0.99,0.99,0.94],
[0.99,0.99,0.95],
[0.99,0.99,0.97],
[1.00,1.00,0.98]];

if nargin < 1
    cm_data = cm;
else
    hsv=rgb2hsv(cm);
    hsv(144:end,1)=hsv(144:end,1)+1; % hardcoded
    cm_data=interp1(linspace(0,1,size(cm,1)),hsv,linspace(0,1,m));
    cm_data(cm_data(:,1)>1,1)=cm_data(cm_data(:,1)>1,1)-1;
    cm_data=hsv2rgb(cm_data);
  
end
end