function plot_arms(figure1, X1, Y1, E1, Y2, pulls, arm_pulled, regret, t)
%CREATEFIGURE(X1,Y1,E1,X2,Y2)
%  X1:  errorbar x
%  Y1:  errorbar y
%  E1:  errorbar e
%  X2:  vector of x data
%  Y2:  vector of y data
%  Auto-generated by MATLAB on 10-Apr-2012 12:09:29

clf;
% Create axes
tick1 = ['1 (' num2str(pulls(1)) ')'];
tick2 = ['2 (' num2str(pulls(2)) ')'];
tick3 = ['3 (' num2str(pulls(3)) ')'];
tick4 = ['4 (' num2str(pulls(4)) ')'];

subp = subplot(1,2,1);

hold(subp,'on');
% Create errorbar
errorbar(subp,X1,Y1,E1,'MarkerSize',10,'Marker','square','LineStyle','none',...
    'LineWidth',2,...
    'Color',[0 0 1]);

% Create plot
plot(subp,X1,Y2,'MarkerSize',10,'Marker','o','LineWidth',2,'LineStyle','none',...
    'Color',[1 0 0]);

plot(subp,arm_pulled,Y1(arm_pulled)+E1(arm_pulled),'MarkerSize',20,'Marker','X','LineWidth',2,'LineStyle','none',...
    'Color',[0 1 0]);

% Create xlabel
xlabel('Arms','FontSize',16);

% Create ylabel
ylabel('Reward','FontSize',16);

%axes1 = axes('Parent',figure1,'XTickLabel',{tick1,tick2,tick3,tick4},'XTick',[1 2 3 4],'FontSize',16);
set(subp,'XTickLabel',{tick1,tick2,tick3,tick4},'XTick',[1 2 3 4],'FontSize',16);
set(subp,'XTickLabel',{tick1,tick2,tick3,tick4},'XTick',[1 2 3 4],'FontSize',16);
set(subp,'ylim',[-1 2]);
set(subp,'xlim',[0.5 4.5]);
set(subp,'box','on');
%axes1 = axis('XTickLabel',{tick1,tick2,tick3,tick4},'XTick',[1 2 3 4],'FontSize',16);
% box(axes1,'on');
% hold(axes1,'all');
% ylim(axes1,[-1 2]);
% xlim(axes1,[0.5 4.5]);

hold(subp,'off');


subplot(1,2,2);

plot(1:t-1,regret(1:t-1));
% Create xlabel
xlabel('Steps','FontSize',16);

% Create ylabel
ylabel('Cum. Regret','FontSize',16);

drawnow;

