clear

% data=importdata('C:\Users\jirka\Desktop\data.txt');
% 
% figure1=figure;
% plot(data(:,1),data(:,3), 'rx-')
% % fill([1:1221,1221:-1:1],[prumer_celkem-std_error_celkem,fliplr(prumer_celkem+std_error_celkem)], 'b', 'FaceAlpha', 0.1, 'EdgeColor','none')
% 
% xlabel('napìtí [V]');
% ylabel('proudová hustota [mA/cm^2]');
% % title(strcat(tlak,' Pa, ',cas,' us predionizace'))
% % axis([0,1.2,0,25])
% legend('0 min')
% % set(gca,'YDir','normal')
% box on
% str={'U_{OC} [V]           1,058','J_S [mA/cm^2]    21,12','FF [-]               0,615','\eta [%]               13,74'};
% a=annotation(figure1,'textbox',...
%     [0.2 0.15 0.14 0.28],...
%     'String',str,...
%     'Interpreter','tex',...
%     'FontSize',9,...
%     'FitBoxToText','on');
% % set(a,'Latex','Interpreter');
% set(gcf,'units','points','position',[350,220,592,333])
% % print('graf_1', '-dpng')
% % movefile('graf_1.png','C:\Users\jirka\Desktop\')
% % close
%%
% %%
data1=importdata('C:\Users\jirka\Desktop\data.txt');
data2=importdata('C:\Users\jirka\Desktop\data2.txt');

figure
suptitle('Dvou-kroková expozice')
subplot(4,1,1)
hold on
plot(data1(:,1),data1(:,2), 'k.-')
plot(data2(:,6),data2(:,7), 'b.-')
fill([0,60,60,0],[0,0,1,1], 'y', 'FaceAlpha', 0.2, 'EdgeColor','none')
fill([60,420,420,60],[0,0,1,1], 'k', 'FaceAlpha', 0.2, 'EdgeColor','none')
xlabel('èas [min]');
ylabel('U_{OC{norm}} [-]');
% legend('U_{OC}','J_S','FF','\eta','Location','southeast')
xlim([0 420])
ylim([0 1])
box on
legend('bílé svìtlo','modré svìtlo','Location', 'southeast')

subplot(4,1,2)
hold on
plot(data1(:,1),data1(:,3), 'k.-')
plot(data2(:,6),data2(:,8), 'b.-')
fill([0,60,60,0],[0,0,1,1], 'y', 'FaceAlpha', 0.2, 'EdgeColor','none')
fill([60,420,420,60],[0,0,1,1], 'k', 'FaceAlpha', 0.2, 'EdgeColor','none')
xlabel('èas [min]');
ylabel('J_{SC{norm}} [-]');
% legend('U_{OC}','J_{SC}','FF','\eta','Location','southeast')
legend('bílé svìtlo','modré svìtlo','Location', 'southeast')
xlim([0 420])
ylim([0 1])
box on

subplot(4,1,3)
hold on
plot(data1(:,1),data1(:,4), 'k.-')
plot(data2(:,6),data2(:,9), 'b.-')
fill([0,60,60,0],[0,0,1,1], 'y', 'FaceAlpha', 0.2, 'EdgeColor','none')
fill([60,420,420,60],[0,0,1,1], 'k', 'FaceAlpha', 0.2, 'EdgeColor','none')
xlabel('èas [min]');
ylabel('FF_{norm} [-]');
% legend('U_{OC}','J_S','FF','\eta','Location','southeast')
legend('bílé svìtlo','modré svìtlo','Location', 'southeast')
xlim([0 420])
ylim([0 1])
box on

subplot(4,1,4)
hold on
plot(data1(:,1),data1(:,5), 'k.-')
plot(data2(:,6),data2(:,10), 'b.-')
fill([0,60,60,0],[0,0,1,1], 'y', 'FaceAlpha', 0.2, 'EdgeColor','none')
fill([60,420,420,60],[0,0,1,1], 'k', 'FaceAlpha', 0.2, 'EdgeColor','none')
xlabel('èas [min]');
ylabel('\eta_{norm} [-]');
% legend('U_{OC}','J_S','FF','\eta','Location','southeast')
legend('bílé svìtlo','modré svìtlo','Location', 'southeast')
xlim([0 420])
ylim([0 1])
box on


% fill([200,250,250,200],[0,0,1,1], 'b', 'FaceAlpha', 0.1, 'EdgeColor','none')

% xticks([0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90])
% xticklabels({'0','5','10','15','20','25','30','35','40','45','50','55','60','65','120','180','240','300','360','420'})

% xlabel('èas [min]');
% ylabel('normalizované hodnoty [-]');
% title(strcat(tlak,' Pa, ',cas,' us predionizace'))
% axis([-10,260,0.77,1.02])
% legend('U_{OC}','J_S','FF','\eta','Location','southeast')
% set(gca,'YDir','normal')

% set(a,'Latex','Interpreter');

% dim1 = [.17 .3 .08 .05];
% str1 = 'osvìtlení 1 slunce';
% a1=annotation('textbox',dim1,'String',str1,'FitBoxToText','on');
% a1.EdgeColor='none';

% dim2 = [.47 .3 .08 .05];
% str2 = 'ponecháno ve tmì';
% a2=annotation('textbox',dim2,'String',str2,'FitBoxToText','on');
% a2.EdgeColor='none';

set(gcf,'units','points','position',[350,60,592,666])
print('graf_060519_4', '-dpng')
% movefile('graf_2.png','C:\Users\jirka\Desktop')
% close

%%
% %%
% data1=importdata('C:\Users\jirka\Desktop\data.txt');
% data2=importdata('C:\Users\jirka\Desktop\data2.txt');

figure
suptitle('Modré svìtlo')
subplot(4,1,1)
hold on
plot(data2(:,1),data2(:,2), 'k.-')
plot(data2(:,6),data2(:,7), 'b.-')
fill([0,60,60,0],[0,0,1,1], 'b', 'FaceAlpha', 0.2, 'EdgeColor','none')
fill([60,420,420,60],[0,0,1,1], 'k', 'FaceAlpha', 0.2, 'EdgeColor','none')
xlabel('èas [min]');
ylabel('U_{OC{norm}} [-]');
% legend('U_{OC}','J_S','FF','\eta','Location','southeast')
xlim([0 420])
ylim([0 1])
box on
legend('jedno-kroková expozice','dvou-kroková expozice','Location', 'southeast')

subplot(4,1,2)
hold on
plot(data2(:,1),data2(:,3), 'k.-')
plot(data2(:,6),data2(:,8), 'b.-')
fill([0,60,60,0],[0,0,1,1], 'b', 'FaceAlpha', 0.2, 'EdgeColor','none')
fill([60,420,420,60],[0,0,1,1], 'k', 'FaceAlpha', 0.2, 'EdgeColor','none')
xlabel('èas [min]');
ylabel('J_{SC{norm}} [-]');
% legend('U_{OC}','J_{SC}','FF','\eta','Location','southeast')
legend('jedno-kroková expozice','dvou-kroková expozice','Location', 'southeast')
xlim([0 420])
ylim([0 1])
box on

subplot(4,1,3)
hold on
plot(data2(:,1),data2(:,4), 'k.-')
plot(data2(:,6),data2(:,9), 'b.-')
fill([0,60,60,0],[0,0,1,1], 'b', 'FaceAlpha', 0.2, 'EdgeColor','none')
fill([60,420,420,60],[0,0,1,1], 'k', 'FaceAlpha', 0.2, 'EdgeColor','none')
xlabel('èas [min]');
ylabel('FF_{norm} [-]');
% legend('U_{OC}','J_S','FF','\eta','Location','southeast')
legend('jedno-kroková expozice','dvou-kroková expozice','Location', 'southeast')
xlim([0 420])
ylim([0 1])
box on

subplot(4,1,4)
hold on
plot(data2(:,1),data2(:,5), 'k.-')
plot(data2(:,6),data2(:,10), 'b.-')
fill([0,60,60,0],[0,0,1,1], 'b', 'FaceAlpha', 0.2, 'EdgeColor','none')
fill([60,420,420,60],[0,0,1,1], 'k', 'FaceAlpha', 0.2, 'EdgeColor','none')
xlabel('èas [min]');
ylabel('\eta_{norm} [-]');
% legend('U_{OC}','J_S','FF','\eta','Location','southeast')
legend('jedno-kroková expozice','dvou-kroková expozice','Location', 'southeast')
xlim([0 420])
ylim([0 1])
box on


% fill([200,250,250,200],[0,0,1,1], 'b', 'FaceAlpha', 0.1, 'EdgeColor','none')

% xticks([0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90])
% xticklabels({'0','5','10','15','20','25','30','35','40','45','50','55','60','65','120','180','240','300','360','420'})

% xlabel('èas [min]');
% ylabel('normalizované hodnoty [-]');
% title(strcat(tlak,' Pa, ',cas,' us predionizace'))
% axis([-10,260,0.77,1.02])
% legend('U_{OC}','J_S','FF','\eta','Location','southeast')
% set(gca,'YDir','normal')

% set(a,'Latex','Interpreter');

% dim1 = [.17 .3 .08 .05];
% str1 = 'osvìtlení 1 slunce';
% a1=annotation('textbox',dim1,'String',str1,'FitBoxToText','on');
% a1.EdgeColor='none';

% dim2 = [.47 .3 .08 .05];
% str2 = 'ponecháno ve tmì';
% a2=annotation('textbox',dim2,'String',str2,'FitBoxToText','on');
% a2.EdgeColor='none';

set(gcf,'units','points','position',[350,60,592,666])
print('graf_060519_5', '-dpng')
% movefile('graf_2.png','C:\Users\jirka\Desktop')
% close