colour.m

来自「细胞生长结构可视化工具箱-MATLAB Toolbox1999.zip」· M 代码 · 共 34 行

M
34
字号
% Calculate a non-linear greyscale colour bar which maximises contrast

NoC = 64;	% No Colours to be used

freq = zeros(NoC,1);

scale = max(max(cmap1/(NoC-1)));

ii=0;
xi=minx:(maxx-minx)/NoPts:maxx;
yi=maxy:-(maxy-miny)/NoPts:miny;
for i=minx:(maxx-minx)/NoPts:maxx
	ii=ii+1;
	jj=NoPts+2;
	for j=maxy:-(maxy-miny)/NoPts:miny
		jj=jj-1;
		Ip=[i,j];
		% Find enclosing triangle
		tri = findtri(Ip,wvis,C);
		if (tri ~= [])	% if is within network
			index = floor(cmap1(jj,ii)./scale) + 1;
			freq(index) = freq(index)+1;
		end;
	end
end

cumfreq=[];
for i=1:NoC
	cumfreq(i) = sum(freq(1:i));
end

plot(freq);
hold on;
plot(cumfreq);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?