70 this.vals(end+1) = value;
71 this.cols[end+1] = color;
72 if ~isequal(color, colorbefore)
74 this.cols[end+1] = colorbefore;
93 dcols[end+1] = [0 0 .5];
98 dcols[end+1] = [.5 0 0];
112 [val, idx] =
sort(dvals,
" ascend ");
113 valrange = linspace(val(1),val(end),this.
Resolution);
114 ncol = length(valrange);
120 curcol = dcols[idx(1)];
121 for k = 2:length(val)
122 nextcol = dcols[idx(
k)];
123 [~,nextpos] = min(abs(valrange-val(
k)));
125 pos = curpos:nextpos;
126 r(pos) = linspace(curcol(1),nextcol(1),length(pos));
127 g(pos) = linspace(curcol(2),nextcol(2),length(pos));
128 b(pos) = linspace(curcol(3),nextcol(3),length(pos));
function addColor(value, color, colorbefore)
LogPlot: Class with static functions for logarithmic plotting.
sort
ort the handle objects in any array in ascending or descending order.
Matlab's base handle class (documentation generation substitute)
function cmap = create(Zdata)