function create_density_cost_figure(X1, Y1, X2, Y2)
%CREATEFIGURE(X1, Y1, X2, Y2)
%  X1:  vector of x data
%  Y1:  vector of y data
%  X2:  scatter x
%  Y2:  scatter y

%  Auto-generated by MATLAB on 09-Nov-2018 14:26:44

% Create figure
figure1 = figure('PaperOrientation','landscape','PaperSize',[11 8.5]);

% Create axes
axes1 = axes('Parent',figure1);
hold(axes1,'on');

% Activate the left side of the axes
yyaxis(axes1,'left');
% Create plot
plot(X1,Y1,'LineWidth',2);
xlim([min(X1) max(X1)])
% Set the remaining axes properties
set(axes1,'YColor',[0 0.450980392156863 0.741176470588235]);
% Activate the right side of the axes
yyaxis(axes1,'right');
% Create scatter
scatter(X2,Y2,'Marker','.');
xlim([min(X1) max(X1)])
ylabel('Consumption equivalent, %')
% Set the remaining axes properties
set(axes1,'YColor',[0.85 0.325 0.098]);
% Uncomment the following line to preserve the X-limits of the axes
% xlim(axes1,[-118.4954771952 126.507224830961]);
box(axes1,'on');
% Create textarrow
annotation(figure1,'textarrow',[0.563658462473412 0.612275903980553],...
    [0.291550603528319 0.392757660167131],...
    'Color',[0 0.450980392156863 0.741176470588235],...
    'String',{'PDF of Home''s NFA,','LHS scale'},...
    'HorizontalAlignment','left');

% Create textarrow
annotation(figure1,'textarrow',[0.747493163172288 0.72835004557885],...
    [0.753017641597029 0.71013251898688],...
    'Color',[0.850980392156863 0.329411764705882 0.101960784313725],...
    'String',{'Cost of unilateral','deviation from','cooperation,','RHS scale'},...
    'HorizontalAlignment','left');

