pes2014/DeviationFigure.m

116 lines
3.7 KiB
Matlab

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-Feb-2015 16:31:59
% Create figure
figure1 = figure('Color',[1 1 1]);
% Create axes
axes1 = axes('Parent',figure1,'XTick',[1 4 7 10 13 16 19 22 25 28 31 33],...
'Position',[0.140663507109006 0.572508000217951 0.537061611374407 0.365998852384935],...
'FontName','Times New Roman');
hold(axes1,'all');
% Create multiple lines using matrix input to plot
plot1 = plot(X1,YMatrix1,'Parent',axes1,'LineStyle',':','Color',[0 0 0]);
set(plot1(1),'Marker','diamond','DisplayName','情形A');
set(plot1(2),'Marker','square','DisplayName','情形B');
set(plot1(3),'Marker','o','DisplayName','情形C');
% Create xlabel
xlabel('节点号','FontName','黑体');
% Create ylabel
ylabel('偏差/p.u','FontName','Times New Roman');
% Create axes
axes2 = axes('Parent',figure1,'XTick',[2 5 8 11 14 17 20 23 26 29 32],...
'Position',[0.143033175355449 0.120301205914361 0.537914691943128 0.365998852384935],...
'FontName','Times New Roman');
% Uncomment the following line to preserve the X-limits of the axes
% xlim(axes2,[2 33]);
hold(axes2,'all');
% Create multiple lines using matrix input to plot
plot2 = plot(X1,YMatrix3,'Parent',axes2,'LineStyle',':','Color',[0 0 0]);
set(plot2(1),'Marker','diamond','DisplayName','算例A');
set(plot2(2),'Marker','square','DisplayName','算例B');
set(plot2(3),'Marker','o','DisplayName','算例C');
% Create xlabel
xlabel('节点号','FontName','Times New Roman');
% Create ylabel
ylabel('相对偏差%','FontName','Times New Roman');
% Create title
title('有功');
% Create axes
axes3 = axes('Parent',figure1,...
'XTickLabel',{'1','4','7','10','13','16','19','22','25','28','31','33'},...
'XTick',[1 4 7 10 13 16 19 22 25 28 31 33],...
'Position',[0.440758293838865 0.574607379571982 0.537914691943128 0.365998852384935]);
hold(axes3,'all');
% Create multiple lines using matrix input to plot
plot3 = plot(X1,YMatrix2,'Parent',axes3,'LineStyle',':','Color',[0 0 0]);
set(plot3(1),'Marker','diamond','DisplayName','情形A');
set(plot3(2),'Marker','square','DisplayName','情形B');
set(plot3(3),'Marker','o','DisplayName','情形C');
% Create xlabel
xlabel('节点号');
% Create ylabel
ylabel('偏差/弧度');
% Create axes
axes4 = axes('Parent',figure1,'XTick',[2 5 8 11 14 17 20 23 26 29 32],...
'Position',[-0.490853080568712 -0.0598281717337482 0.537914691943128 0.365998852384935]);
% Uncomment the following line to preserve the X-limits of the axes
% xlim(axes4,[2 33]);
hold(axes4,'all');
% Create multiple lines using matrix input to plot
plot4 = plot(X1,YMatrix4,'Parent',axes4,'LineStyle',':','Color',[0 0 0]);
set(plot4(1),'Marker','diamond','DisplayName','算例A');
set(plot4(2),'Marker','square','DisplayName','算例B');
set(plot4(3),'Marker','o','DisplayName','算例C');
% Create xlabel
xlabel('节点号');
% Create ylabel
ylabel('相对偏差%');
% Create legend
legend1 = legend(axes1,'show');
set(legend1,...
'Position',[0.155301294649576 0.633902089695378 0.112559241706161 0.12206572769953],...
'FontName','黑体');
% Create legend
legend2 = legend(axes2,'show');
set(legend2,...
'Position',[0.533220206544619 0.178635859349444 0.112559241706161 0.12206572769953],...
'FontName','黑体');
% Create legend
legend3 = legend(axes3,'show');
set(legend3,...
'Position',[0.450281817919025 0.807479462339755 0.117298578199052 0.12206572769953],...
'FontName','黑体');
% Create legend
legend4 = legend(axes4,'show');
set(legend4,...
'Position',[-0.098296381133102 -0.0539564029130473 0.117298578199052 0.122065727699531]);