function errorvsentropy_plot(fig_n, subject, cm_i, CV_ORDER, N, pe_order, s_order, Hrow, sigma, VOWSTIM_LIST, CONSTIM_LIST, CONSTIM_LIST_ED)

% create scatter plot
% Plot reference lines
figure(fig_n)
x=[1:100]/100;
H1=log2((x).^(-x))+log2(((1-x)).^(-(1-x)));
H2=log2((x).^(-x))+2*log2((((1-x)/2)).^(-(1-x)/2));
H3=log2((x).^(-x))+3*log2((((1-x)/3)).^(-(1-x)/3));
plot(x,H1,'LineStyle','-','Color',[0.6 0.6 0.6]);hold on;
plot(1-x,H2,'LineStyle','-','Color',[0.6 0.6 0.6]);
plot(1-x,H3,'LineStyle','-','Color',[0.6 0.6 0.6]);
%plot(pe_order(:,1),Hrow(s_order),'MarkerSize',8,'Marker','x','LineStyle','none');
errorbar(pe_order(:,1),Hrow(s_order),sigma, 'MarkerSize',8,'Marker','x','LineStyle','none');
%errorbar,p*100,, '.', 'Color', [0,0,0])
hold off
xlabel('Error','Fontsize',18);
ylabel('Entropy [bits]','Fontsize',18);
xlim([0, 1]);
ylim([0, max(Hrow)+0.2]);


for pe_i=1:length(pe_order)
    if cm_i < 3
        txt=sprintf('%s', VOWSTIM_LIST{s_order(pe_i)});
    else
        txt=sprintf('%s', CONSTIM_LIST{s_order(pe_i)});
    end
    if Hrow(s_order(pe_i)) > 1
        txt= [txt sprintf('_{%i}', N(s_order(pe_i)))];
    end
    
    text(pe_order(pe_i,1)+0.01, Hrow(s_order(pe_i))+0.01 , txt, 'FontSize', 12);
end

if cm_i == 1
    title(sprintf('NSCM %s: Scatter Plot Vowels in Inital Position ', subject),'Fontsize',18);
elseif cm_i == 2
    title(sprintf('NSCM %s: Scatter Plot Vowels in Final Position ', subject),'Fontsize',18);
elseif cm_i == 3
    title(sprintf('NSCM %s: Scatter Plot Consonants in Inital Position ', subject),'Fontsize',18);
elseif cm_i == 4
    title(sprintf('NSCM %s: Scatter Plot Consonants in Final Position ', subject),'Fontsize',18);
end
fname = sprintf('scatterplot_%s_%s.eps', subject, CV_ORDER{cm_i});
print(gcf, fullfile('graphics', fname), '-depsc2'); % print stacked barplot to eps