function result = stimBrewerMap(R) %returns a Brewer colormap with the specified resolution R ctrlPts = zeros(12, 3); ctrlPts(1, :) = [0, 0, 0]; ctrlPts(2, :) = [0.192157, 0.211765, 0.584314]; ctrlPts(3, :) = [0.270588, 0.458824, 0.705882]; ctrlPts(4, :) = [0.454902, 0.678431, 0.819608]; ctrlPts(5, :) = [0.670588, 0.85098, 0.913725]; ctrlPts(6, :) = [0.878431, 0.952941, 0.972549]; ctrlPts(7, :) = [1, 1, 0.74902]; ctrlPts(8, :) = [0.996078, 0.878431, 0.564706]; ctrlPts(9, :) = [0.992157, 0.682353, 0.380392]; ctrlPts(10, :) = [0.956863, 0.427451, 0.262745]; ctrlPts(11, :) = [0.843137, 0.188235, 0.152941]; ctrlPts(12, :) = [0.647059, 0, 0.14902]; X = 1:12; r = 1:12/R:12; R = interp1(X, ctrlPts(:, 1), r); G = interp1(X, ctrlPts(:, 2), r); B = interp1(X, ctrlPts(:, 3), r); result = [R' G' B'];