问题:在绘制条形图时,Matlab默认以颜色区分不同的立柱,然而
现实中我们偶尔会需要用填充图案来进行区分,如下图所示。
利用代码hatchfill.m可以实现上述需求,代码下载链接点击打开链接
调用方式为:
h=bar([tot11,tot12,tot13,tot14,tot15;tot21,tot22,tot23,tot24,tot25]);
hp = findobj(h,'type','patch');
hatchfill(hp(1),'single',45,3,'r');
hatchfill(hp(2),'single',180,3,'b');
hatchfill(hp(3),'single',135,3,'g')