function applyhatch(h,patterns,colorlist)%APPLYHATCH Apply hatched patterns to a figure% APPLYHATCH(H,PATTERNS) creates a new figure fromthe figure H by% replacing distinct colors inH with the black and white% patterns in PATTERNS. The format forPATTERNS 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 islimited% to low-resolution, bitmap output.%
% Example 1:% bar(rand(3,4));% applyhatch(gcf,'\-x.');%
% Example 2:% colormap(cool(6));% pie(rand(6,1));% legend('Jan','Feb','Mar','Apr','May','Jun');% applyhatch(gcf,'|-+.\/&#