function createfigure(X1, YMatrix1, YMatrix2, YMatrix3, YMatrix4) %CREATEFIGURE(X1,YMATRIX1,YMATRIX2,YMATRIX3,YMATRIX4) % X1: vector of x data % YMATRIX1: matrix of y data % YMATRIX2: matrix of y data % YMATRIX3: matrix of y data % YMATRIX4: matrix of y data % Auto-generated by MATLAB on 11-Mar-2015 20:41:09 % Create figure figure1 = figure('Color',[1 1 1]); % Create axes axes1 = axes('Parent',figure1,'XTick',[4 7 10 13 16 19 22 25 28 31 33],... 'Position',[0.115147103706819 0.314443484088918 0.537061611374407 0.365998852384935],... 'FontName','Times New Roman'); % Uncomment the following line to preserve the X-limits of the axes % xlim(axes1,[1 33]); hold(axes1,'all'); % Create multiple lines using matrix input to plot plot1 = plot(X1,YMatrix1,'Parent',axes1,'Marker','.','LineStyle',':'); set(plot1(1),'DisplayName','情形A','Color',[0 0 0]); set(plot1(2),'Color',[0 0.498039215803146 0],'DisplayName','情形B'); set(plot1(3),'DisplayName','情形C'); % Create xlabel xlabel('节点号','FontSize',11); % Create ylabel ylabel('偏差/p.u','FontName','Times New Roman'); % Create axes axes2 = axes('Parent',figure1,'XTick',[4 7 10 13 16 19 22 25 28 31 33],... 'Position',[0.834048901507269 0.363093241598628 0.537914691943128 0.365998852384935],... 'FontName','Times New Roman'); % Uncomment the following line to preserve the X-limits of the axes % xlim(axes2,[1 33]); hold(axes2,'all'); % Create multiple lines using matrix input to plot plot2 = plot(X1,YMatrix2,'Parent',axes2,'Marker','.','LineStyle',':'); set(plot2(1),'DisplayName','算例A','Color',[0 0 0]); set(plot2(2),'Color',[0 0.498039215803146 0],'DisplayName','算例B'); set(plot2(3),'DisplayName','算例C'); % Create xlabel xlabel('节点号','FontName','Times New Roman'); % Create ylabel ylabel('偏差/rad','FontName','Times New Roman'); % Create title title('相角','FontName','Times New Roman'); % Create axes axes3 = axes('Parent',figure1,... 'XTickLabel',{'4','7','10','13','16','19','22','25','28','31','33'},... 'XTick',[4 7 10 13 16 19 22 25 28 31 33],... 'Position',[0.929411860358798 0.568558992475202 0.537914691943128 0.365998852384935]); % Uncomment the following line to preserve the X-limits of the axes % xlim(axes3,[1 33]); hold(axes3,'all'); % Create multiple lines using matrix input to plot plot3 = plot(X1,YMatrix3,'Parent',axes3,'Marker','.','LineStyle',':'); set(plot3(1),'DisplayName','情形A','Color',[0 0 0]); set(plot3(2),'Color',[0 0.498039215803146 0],'DisplayName','情形B'); set(plot3(3),'DisplayName','情形C'); % Create xlabel xlabel('节点号'); % Create ylabel ylabel('相对偏差%'); % Create axes axes4 = axes('Parent',figure1,'XTick',[4 7 10 13 16 19 22 25 28 31 33],... 'Position',[0.918232282855782 0.0199442763883023 0.537914691943128 0.365998852384935]); % Uncomment the following line to preserve the X-limits of the axes % xlim(axes4,[1 33]); hold(axes4,'all'); % Create multiple lines using matrix input to plot plot4 = plot(X1,YMatrix4,'Parent',axes4,'Marker','.','LineStyle',':'); set(plot4(1),'DisplayName','算例A','Color',[0 0 0]); set(plot4(2),'Color',[0 0.498039215803146 0],'DisplayName','算例B'); set(plot4(3),'DisplayName','算例C'); % Create xlabel xlabel('节点号'); % Create ylabel ylabel('相对偏差%'); % Create legend legend1 = legend(axes1,'show'); set(legend1,... 'Position',[0.128348837738379 0.375714523437614 0.11543134872418 0.122311827956989],... 'FontName','黑体'); % Create legend legend2 = legend(axes2,'show'); set(legend2,... 'Position',[0.848559295955351 0.401143554582401 0.11543134872418 0.122311827956989],... 'FontName','黑体'); % Create legend legend3 = legend(axes3,'show'); set(legend3,... 'Position',[0.942299132833744 0.801308025114244 0.120291616038882 0.122311827956989],... 'FontName','黑体'); % Create legend legend4 = legend(axes4,'show'); set(legend4,... 'Position',[0.933836813310721 0.249483317660918 0.120291616038882 0.122311827956989]);