From 9f87643c124d3521ba9b0ac5f2c78cf7fa034ee5 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 27 Oct 2016 01:22:54 -0500 Subject: [PATCH] updated brewer color map function name: --- matlab/brewermap.m | 28 ---------------------------- matlab/stimBrewerMap.m | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 28 deletions(-) delete mode 100644 matlab/brewermap.m create mode 100644 matlab/stimBrewerMap.m diff --git a/matlab/brewermap.m b/matlab/brewermap.m deleted file mode 100644 index 0a2c521..0000000 --- a/matlab/brewermap.m +++ /dev/null @@ -1,28 +0,0 @@ -function result = stimBrewerColormap(R) - -%returns a Brewer colormap with the specified resolution R - -ctrlPts = zeros(11, 3); - -ctrlPts(1, :) = [0.192157, 0.211765, 0.584314]; -ctrlPts(2, :) = [0.270588, 0.458824, 0.705882]; -ctrlPts(3, :) = [0.454902, 0.678431, 0.819608]; -ctrlPts(4, :) = [0.670588, 0.85098, 0.913725]; -ctrlPts(5, :) = [0.878431, 0.952941, 0.972549]; -ctrlPts(6, :) = [1, 1, 0.74902]; -ctrlPts(7, :) = [0.996078, 0.878431, 0.564706]; -ctrlPts(8, :) = [0.992157, 0.682353, 0.380392]; -ctrlPts(9, :) = [0.956863, 0.427451, 0.262745]; -ctrlPts(10, :) = [0.843137, 0.188235, 0.152941]; -ctrlPts(11, :) = [0.647059, 0, 0.14902]; - -X = 1:11; - -r = 1:11/R:11; - -R = interp1(X, ctrlPts(:, 1), r); -G = interp1(X, ctrlPts(:, 2), r); -B = interp1(X, ctrlPts(:, 3), r); - -result = [R' G' B']; - diff --git a/matlab/stimBrewerMap.m b/matlab/stimBrewerMap.m new file mode 100644 index 0000000..0a2c521 --- /dev/null +++ b/matlab/stimBrewerMap.m @@ -0,0 +1,28 @@ +function result = stimBrewerColormap(R) + +%returns a Brewer colormap with the specified resolution R + +ctrlPts = zeros(11, 3); + +ctrlPts(1, :) = [0.192157, 0.211765, 0.584314]; +ctrlPts(2, :) = [0.270588, 0.458824, 0.705882]; +ctrlPts(3, :) = [0.454902, 0.678431, 0.819608]; +ctrlPts(4, :) = [0.670588, 0.85098, 0.913725]; +ctrlPts(5, :) = [0.878431, 0.952941, 0.972549]; +ctrlPts(6, :) = [1, 1, 0.74902]; +ctrlPts(7, :) = [0.996078, 0.878431, 0.564706]; +ctrlPts(8, :) = [0.992157, 0.682353, 0.380392]; +ctrlPts(9, :) = [0.956863, 0.427451, 0.262745]; +ctrlPts(10, :) = [0.843137, 0.188235, 0.152941]; +ctrlPts(11, :) = [0.647059, 0, 0.14902]; + +X = 1:11; + +r = 1:11/R:11; + +R = interp1(X, ctrlPts(:, 1), r); +G = interp1(X, ctrlPts(:, 2), r); +B = interp1(X, ctrlPts(:, 3), r); + +result = [R' G' B']; + -- libgit2 0.21.4