【matlab】渐变填充曲线













































































































































clear;clc;close all;
n=4;
x=0:n*pi/499:n*pi;
y=sin(x);
% 颜色包
for nm=2:69
CM=load(['D:\matlab_work\函数名为colormore的颜色索引表制作\colormore_txt\colormore_',num2str(nm),'.txt']);
% 画图
figure
set(gcf,'color','w','Position',[50 50 1050 750])
for i=1:length(y)
h=line([x(i) x(i)],[0 y(i)],'color',CM(i,:),'MarkerEdgeColor',CM(i,:),'MarkerFaceColor',CM(i,:),'linewidth',3);
hold on
plot(x(i),y(i),'color',CM(i,:),'linewidth',2);
end
hold on
set(gca,'xtick',[],'XTickLabel',[],'ytick',[],'yTickLabel',[],'xcolor','w','ycolor','w');
% axis equal
% line([0 pi],[0 0],'linewidth',2,'color','k');
export_fig([num2str(n),'_',num2str(nm),'1.jpg'],'-r300')
figure
for i=1:length(y)
h=line([x(i) x(i)],[0 y(i)],'color',CM(i,:),'MarkerEdgeColor',CM(i,:),'MarkerFaceColor',CM(i,:),'linewidth',3);
hold on
end
hold on
plot(x,y,'color','k','linewidth',2);
% line([0 pi],[0 0],'linewidth',2,'color','k');
set(gca,'xtick',[],'XTickLabel',[],'ytick',[],'yTickLabel',[],'xcolor','w','ycolor','w');
set(gcf,'color','w','Position',[50 50 1050 750])
% axis equal
export_fig([num2str(n),'_',num2str(nm),'2.jpg'],'-r300')
close all
end