最近写论文时,想做一个柱状图,但MATLAB自带画柱状图时是纯颜色填充,我想将颜色去掉,并填充一些形状,从网上下载一个函数但发现无法使用,请各位指点,看如何将该函数修改好,以后写论文画图就方便了。代码如下:
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 specifies an RGB
% color value.
%% Note this function makes a bitmap image of H and so is limited
% to low-resoluti