function c = redblue(m)

if nargin < 1, m = size(get(gcf,'colormap'),1);end

if mod(m,2) == 0;
    
    m1 = m*.5;
    r = (0:m1-1)'/max(m1-1,1);
    g = r;
    r = [r;ones(m1,1)];
    g = [g;flipud(g)];
    b = flipud(r);
else
    
    m1 = floor(m*.5);
    r = (0:m1-1)'/max(m1,1);
    g = r;
    r = [r;ones(m1+1,1)];
    g = [g; 1; flipud(g)];
    b = flipud(r);
end
c = [r g b];
end
