总结于
使用hatchfill.m 完成柱形图的填充编辑
figure(10);%VAF Plot
Bar=bar(VAFBar*100);
BarH = findobj(Bar,'type','patch');
hatchfill(BarH(1),'single',45,1,'r');
hatchfill(BarH(2),'single',180,0.2,'b');
hatchfill(BarH(3),'single',135,1,'g');
hatchfill(BarH(4),'cross',180,1,'m');
hatchfill(BarH(5),'cross',135,1,'c');
grid on;
%ch = get(Bar,'children');
set(gca,'XTickLabel',{'Uniform1','Vortex1','Uniform2','Vortex2'})
% set(ch,'FaceVertexCData',[1 0 1;0 0 0;])
%legend('Optimized A D','Optimized B D1','Optimized B D2','Optimized B D3','Optimized B D4','Optimized B D5','Location','SouthEast');
Legend=legend('Optimized A D1','Optimized A D2','Optimized B D1','Optimized B D2','Optimized B D3',0);
LegendH = findobj(Legend,'type','patch');
hatchfill(LegendH(1),'single',45,1,'r');
hatchfill(LegendH(2),'single',180,0.2,'b');
hatchfill(LegendH(3),'single',135,1,'g');
hatchfill(LegendH(4),'cross',180,1,'m');
hatchfill(LegendH(5),'cross',135,1,'c');
xlabel('Conditions ','FontSize',26,'Fontname','times new Roman');
ylabel('R^2 ( % )','FontSize',26,'Fontname','times new Roman');
axis([0.5 4.5 95 100]);
set(gca,'Fontname','times new Roman','FontSize',26);