function createfigure(ymatrix1) % Created by Qi Chen % on 30-Oct-2007 00:00:47 % Create figure figure1 = figure('XVisual',... '0x22 (TrueColor, depth 24, RGB mask 0xff0000 0xff00 0x00ff)'); % Create axes axes1 = axes('Parent',figure1,'YGrid','on',... 'XTickLabel',{'Rectangular','Triangle','Sinc','Spline'},... 'XTick',[1 2 3 4],... 'XGrid','on'); % Uncomment the following line to preserve the X-limits of the axes xlim([0.5 6]); box('on'); hold('all'); % Create multiple lines using matrix input to bar bar1 = bar(ymatrix1,'Parent',axes1); set(bar1(1),'DisplayName','T_s=0.01s'); set(bar1(1),'DisplayName','T_s=0.01s'); set(bar1(2),'DisplayName','T_s=0.05s'); set(bar1(3),'DisplayName','T_s=0.1s'); % Create legend legend(axes1,'show');