Re: [绘图] 请教有关颜色的问题

楼主: prouno (QQ)   2016-02-18 11:07:01
cmap = colormap('jet') ;
% cmap 可以先存起来
% (default 为 6-bit colormap,想要更多色彩请再自行内插)
a = max(cdata) ;
b = min(cdata) ;
h = zeros(ndata,1) ;
markersize = 5 ;
figure ;
for i = 1:ndata
v = (cdata(i)-b)/(b-a) ;
k = round(v*size(cmap,1)) ;
h(i) = line(X(i),Y(i),'marker','o','markerfacecolor',cmap(k,:),...
'markersize',markersize) ;
hold on
end

Links booklink

Contact Us: admin [ a t ] ucptt.com