本帖最后由 meatball1982 于 2012-5-9 19:05 编辑
bar.jpg (58.86 KB, 下载次数: 33)
2012-5-9 19:04 上传
baidu的。
主程序。
暂定好用。
颜色的可以自己定义,matlab就有。
斜线和X在applyhatch里有。
data = [96.3,92.6,71.2;95.7,93.6,83.9;96.8,94.3,78.3;95.8,92.7,80.3]
bar(data,1)
axis([0 6 0.0 100])
legend('方法','exited','Square')
set(gca,'XTickLabel',{'Img1','Img2','Img3','Img4'})
applyhatch(gcf,'\.x.')
applyhatch函数:
function applyhatch(h,patterns,colorlist)
%APPLYHATCH Apply hatched patterns to a figure
% APPLYHATCH(H,PATTERNS) creates a new figure from the figure H by
% replacing distinct colors in H with the black and white
% patterns in PATTERNS. The format for PATTERNS can be
% a string of the characters '/', '\', '|', '-', '+', 'x', '.'
% a cell array of matrices of zeros (white) and ones (black)
%
% APPLYHATCH(H,PATTERNS,COLORS) maps the colors in the n by 3
% matrix COLORS to PATTERNS. Each row of COLORS spe