function createfigure(XMatrix1, YMatrix1, p_elmo1, pwr_elmo1)
%CREATEFIGURE(XMatrix1, YMatrix1, p_elmo1, pwr_elmo1)
%  XMATRIX1:  matrix of plot x data
%  YMATRIX1:  matrix of plot y data
%  P_ELMO1:  vector of plot x data
%  PWR_ELMO1:  vector of plot y data

%  Auto-generated by MATLAB on 04-Aug-2025 14:09:49

% Create figure
figure1 = figure('Name','Figure','Color',[1 1 1]);

% Create axes
axes1 = axes('Position',[0.130390625 0.11 0.775 0.815]);
hold(axes1,'on');

% Create multiple line objects using matrix input to plot
plot1 = plot(XMatrix1,YMatrix1,'MarkerSize',4,'Marker','x','LineWidth',1);
set(plot1(1),'DisplayName','500 RPM');
set(plot1(2),'DisplayName','1000 RPM','Color',[0.5 0 0.5]);
set(plot1(3),'DisplayName','2000 RPM');

% Create plot
plot(p_elmo1,pwr_elmo1,'DisplayName','Elmo at 1000 RPM','MarkerSize',3,...
    'Marker','o',...
    'LineWidth',1,...
    'LineStyle','--',...
    'ZDataSource','');

% Create ylabel
ylabel({'Power (W)'},'FontWeight','bold');

% Create xlabel
xlabel('Pressure (dBar)','FontWeight','bold');

% Create title
title('Power vs Pressure at 28.8V','FontWeight','bold');

box(axes1,'on');
grid(axes1,'on');
hold(axes1,'off');
% Set the remaining axes properties
set(axes1,'FontSize',12,'LineWidth',1);
% Create legend
legend(axes1,'show');

% Create textbox
annotation(figure1,'textbox',...
    [0.2875 0.349015045365077 0.156447245380812 0.0599647253699194],...
    'Color',[0.466666666666667 0.674509803921569 0.188235294117647],...
    'String',{'50% ↑ efficiency'},...
    'FontWeight','bold',...
    'FontSize',14,...
    'EdgeColor',[1 1 1]);

% Create textbox
annotation(figure1,'textbox',...
    [0.441796875000001 0.397565281373169 0.156447245380812 0.0599647253699194],...
    'Color',[0.466666666666667 0.674509803921569 0.188235294117647],...
    'String',{'60% ↑ efficiency'},...
    'FontWeight','bold',...
    'FontSize',14,...
    'EdgeColor',[1 1 1]);

% Create arrow
annotation(figure1,'arrow',[0.285546875 0.28515625],...
    [0.4871995954147 0.277815239379636],...
    'Color',[0.466666666666667 0.674509803921569 0.188235294117647],...
    'LineWidth',2);

% Create arrow
annotation(figure1,'arrow',[0.673046875 0.673046875],...
    [0.762643290627107 0.359406608226568],...
    'Color',[0.466666666666667 0.674509803921569 0.188235294117647],...
    'LineWidth',2);

% Create arrow
annotation(figure1,'arrow',[0.440234375000004 0.440234375000008],...
    [0.642616318273769 0.308159136884693],...
    'Color',[0.466666666666667 0.674509803921569 0.188235294117647],...
    'LineWidth',2);

% Create textbox
annotation(figure1,'textbox',...
    [0.675000000000004 0.481179576720437 0.156447245380812 0.0599647253699194],...
    'Color',[0.466666666666667 0.674509803921569 0.188235294117647],...
    'String',{'65% ↑ efficiency'},...
    'FontWeight','bold',...
    'FontSize',14,...
    'EdgeColor',[1 1 1]);

