% Plot Points in Black
hold on

for idx = 1:numel(s)
    
% legend('Exponential', 'Gaussian', 'Hagfors','AutoUpdate','off');
aveSigma0 = 10.*log10(mean(s(idx).sigma0));
errorSigma0 = 10.*std(s(idx).sigma0)./mean(s(idx).sigma0)./log(10); %Error propogation for natural logarithm
aveInc = mean(s(idx).inc);
errorInc = std(s(idx).inc);
% plot(aveInc,aveSigma0, 'xk');

errorbar(aveInc,aveSigma0,errorSigma0, '.k');

end


for idx = 1:numel(s)

% legend('Exponential', 'Gaussian', 'Hagfors', "Simple Two Layer" ,'AutoUpdate','on');
aveAltSigma0 = 10.*log10(mean(s(idx).alt_sigma0));
errorAltSigma0 = 10.*std(s(idx).alt_sigma0)./mean(s(idx).alt_sigma0)./log(10); %Error propogation for natural logarithm
aveAltInc = mean(s(idx).alt_inc);
errorAltInc = std(s(idx).alt_inc);
% plot(aveAltInc,aveAltSigma0, 'xk');

errorbar(aveAltInc,aveAltSigma0,errorAltSigma0, 'ok');

end

fixfig



% % Plot Points in Black
% hold on
% 
% for idx = 1:numel(s)
% 
% % legend('Exponential', 'Gaussian', 'Hagfors','AutoUpdate','off');
% aveSigma0 = 10.*log10(mean(s(idx).sigma0));
% errorSigma0 = 10.*std(s(idx).sigma0)./mean(s(idx).sigma0)./log(10); %Error propogation for natural logarithm
% aveInc = mean(s(idx).inc);
% errorInc = std(s(idx).inc);
% % plot(aveInc,aveSigma0, 'xk');
% 
% errorbar(aveInc,aveSigma0,errorSigma0./2, 'xk');
% 
% end
% 
% 
% for idx = 1:numel(s)
% 
% % legend('Exponential', 'Gaussian', 'Hagfors', "Simple Two Layer" ,'AutoUpdate','on');
% aveAltSigma0 = 10.*log10(mean(s(idx).alt_sigma0));
% errorAltSigma0 = 10.*std(s(idx).alt_sigma0)./mean(s(idx).alt_sigma0)./log(10); %Error propogation for natural logarithm
% aveAltInc = mean(s(idx).alt_inc);
% errorAltInc = std(s(idx).alt_inc);
% % plot(aveAltInc,aveAltSigma0, 'xk');
% 
% errorbar(aveAltInc,aveAltSigma0,errorAltSigma0./2, 'xk');
% 
% end
% 
% fixfig



% Plot, using s and the code I wrote before to plot each data point with
% error bars properly


%ilytyispfm

% Plot Points in Black (MEDIAN)
% hold on
% for idx = 1:numel(s)
%     % Convert to dB scale first
%     sigma0_db = 10 * log10(s(idx).sigma0);
% 
%     % Calculate median and percentiles in dB scale
%     medianSigma0 = median(sigma0_db);
%     percentile25 = prctile(sigma0_db, 25);
%     percentile75 = prctile(sigma0_db, 75);
% 
%     % Calculate median incidence angle
%     medianInc = median(s(idx).inc);
% 
%     % Plot errorbar
%     errorbar(medianInc, medianSigma0, medianSigma0 - percentile25, percentile75 - medianSigma0, 'k.');
% end
% 
% % Repeat for alt_sigma0 and alt_inc
% for idx = 1:numel(s)
%     % Convert to dB scale first
%     alt_sigma0_db = 10 * log10(s(idx).alt_sigma0);
% 
%     % Calculate median and percentiles in dB scale
%     medianAltSigma0 = median(alt_sigma0_db);
%     percentile25Alt = prctile(alt_sigma0_db, 25);
%     percentile75Alt = prctile(alt_sigma0_db, 75);
% 
%     % Calculate median alternative incidence angle
%     medianAltInc = median(s(idx).alt_inc);
% 
%     % Plot errorbar
%     errorbar(medianAltInc, medianAltSigma0, medianAltSigma0 - percentile25Alt, percentile75Alt - medianAltSigma0, 'k.');
% end
% 
% fixfig