42 MarkerStyles = {
"'s','d','o','*','p','x','+','^','v','<','>','.','h'"};
54 0.2500 0.2500 0.2500,\
97 predef = [ 0 0 1.0000;
103 0.2500 0.2500 0.2500];
105 seed = round(100*cputime);
107 ncolors = size(predef,1);
114 colors = zeros(ncolors,3);
115 colors(1:np,:) = predef;
116 r = RandStream(
" mt19937ar ",
" Seed ",seed);
119 color = r.rand(1,3)*maxintensity;
121 while any(sum(abs(repmat(color,np+n-1,1)-colors(1:np+n-1,:)),2) < mindiff)
122 color = r.rand(1,3)*maxintensity;
125 mindiff = mindiff*.8;
126 fprintf(
" LinSpecIterator: Couldn "" t find any new sufficiently distant color. Choosing new mindiff=%g\n ",mindiff);
130 colors(np+n,:) = color;
134 this.Colors= predef(1:ncolors,:);
147 this.curl= mod(this.curl+1,length(this.
LineStyles));
153 this.cursc= mod(this.cursc+1,length(this.
ShortColors));
162 this.cursc= mod(this.cursc+1,length(this.
ShortColors));
167 color = this.
Colors(this.curc+1,:);
168 this.curc= mod(this.curc+1,size(this.
Colors,1));
169 if ~isempty(this.excluded_cols)
171 while any(sum(abs(repmat(color,size(this.excluded_cols,1),1)-this.excluded_cols),2) < .3)
173 color = this.
Colors(this.curc+1,:);
174 this.curc= mod(this.curc+1,size(this.
Colors,1));
177 if cnt == size(this.
Colors,1)
178 warning(
" KerMor:LineSpecInterator ",...
179 " Out of pre-defined colors (all excluded). Using random color. ");
193 elseif ishandle(data)
196 color = [color;
get(data(i),
" Color ")];
200 this.excluded_cols= [this.excluded_cols; color];
Colors
start of custom colors
function excludeColor(data)
LineSpecIterator(ncolors, seed)
Matlab's base handle class (documentation generation substitute)
function color = nextColor()
function markerstyle = nextMarkerStyle()
function linestyle = nextLineStyle()
function ls = nextColorLineStyle()
function c = nextShortColor(linestyle)
LinSpecIterator: Small helper class to automatically iterate through different line styles/markers/co...