Added new routine to analyse multiple PCAs together, minor modifications to other routines.

This commit is contained in:
Karthik 2025-09-11 18:55:01 +02:00
parent ebb0552866
commit 22004110e0
8 changed files with 254 additions and 69 deletions

View File

@ -18,8 +18,8 @@ function plotCumulants(scan_vals, cumulant_data, varargin)
addParameter(p, 'XLabel', 'Scan Parameter', @ischar);
addParameter(p, 'FigNum', 1, @(x) isnumeric(x) && isscalar(x));
addParameter(p, 'FontName', 'Arial', @ischar);
addParameter(p, 'MarkerSize', 6, @isnumeric);
addParameter(p, 'LineWidth', 1.5, @isnumeric);
addParameter(p, 'MarkerSize', 8, @isnumeric);
addParameter(p, 'LineWidth', 2, @isnumeric);
addParameter(p, 'SkipSaveFigures', false, @islogical);
addParameter(p, 'SaveFileName', 'cumulants.fig', @ischar);
addParameter(p, 'SaveDirectory', pwd, @ischar);
@ -42,10 +42,18 @@ function plotCumulants(scan_vals, cumulant_data, varargin)
tLayout = tiledlayout(2,2,'TileSpacing','compact','Padding','compact');
% Define style
plotColor = [0.2 0.4 0.7];
% --- Mean ---
nexttile;
errorbar(scan_vals, mean_vals, sqrt(var_vals), 'o-', ...
'LineWidth', opts.LineWidth, 'MarkerSize', opts.MarkerSize);
nexttile; hold on;
plot(scan_vals, mean_vals, '-o', ...
'Color', plotColor, 'LineWidth', opts.LineWidth, 'MarkerSize', opts.MarkerSize, ...
'MarkerFaceColor', plotColor);
% add error bars on top of styled plot
plot(scan_vals, mean_vals, '-o', ...
'Color', plotColor, 'LineWidth', opts.LineWidth, 'MarkerSize', opts.MarkerSize, ...
'MarkerFaceColor', plotColor);
title('Mean', 'FontSize', titleFontSize, 'FontWeight', 'bold');
xlabel(opts.XLabel, 'FontSize', labelFontSize);
ylabel('\kappa_1', 'FontSize', labelFontSize);
@ -53,8 +61,10 @@ function plotCumulants(scan_vals, cumulant_data, varargin)
grid on;
% --- Variance ---
nexttile;
plot(scan_vals, var_vals, 's-', 'LineWidth', opts.LineWidth, 'MarkerSize', opts.MarkerSize);
nexttile; hold on;
plot(scan_vals, var_vals, '-o', ...
'Color', plotColor, 'LineWidth', opts.LineWidth, 'MarkerSize', opts.MarkerSize, ...
'MarkerFaceColor', plotColor);
title('Variance', 'FontSize', titleFontSize, 'FontWeight', 'bold');
xlabel(opts.XLabel, 'FontSize', labelFontSize);
ylabel('\kappa_2', 'FontSize', labelFontSize);
@ -62,8 +72,10 @@ function plotCumulants(scan_vals, cumulant_data, varargin)
grid on;
% --- Skewness ---
nexttile;
plot(scan_vals, skew_vals, 'd-', 'LineWidth', opts.LineWidth, 'MarkerSize', opts.MarkerSize);
nexttile; hold on;
plot(scan_vals, skew_vals, '-o', ...
'Color', plotColor, 'LineWidth', opts.LineWidth, 'MarkerSize', opts.MarkerSize, ...
'MarkerFaceColor', plotColor);
title('Skewness', 'FontSize', titleFontSize, 'FontWeight', 'bold');
xlabel(opts.XLabel, 'FontSize', labelFontSize);
ylabel('\kappa_3', 'FontSize', labelFontSize);
@ -71,8 +83,10 @@ function plotCumulants(scan_vals, cumulant_data, varargin)
grid on;
% --- Binder Cumulant ---
nexttile;
plot(scan_vals, fourth_order_vals, '^-', 'LineWidth', opts.LineWidth, 'MarkerSize', opts.MarkerSize);
nexttile; hold on;
plot(scan_vals, fourth_order_vals, '-o', ...
'Color', plotColor, 'LineWidth', opts.LineWidth, 'MarkerSize', opts.MarkerSize, ...
'MarkerFaceColor', plotColor);
title('Binder Cumulant', 'FontSize', titleFontSize, 'FontWeight', 'bold');
xlabel(opts.XLabel, 'FontSize', labelFontSize);
ylabel('\kappa_4', 'FontSize', labelFontSize);
@ -90,4 +104,4 @@ function plotCumulants(scan_vals, cumulant_data, varargin)
'SaveDirectory', opts.SaveDirectory, ...
'SkipSaveFigures', opts.SkipSaveFigures);
end
end

View File

@ -94,7 +94,7 @@ function plotG2PDF(results, theta_query, varargin)
% --- Plot heatmap ---
fig = figure(opts.FigNum); clf(fig);
set(fig, 'Color', 'w', 'Position',[100 100 950 750]);
set(fig, 'Color', 'w', 'Position', [100 100 950 750]);
if strcmpi(opts.PlotType,'kde')
imagesc(referenceValues, y_grid, pdf_matrix);
else

View File

@ -0,0 +1,139 @@
function plotMultiplePCAResults(pcaResults, scan_parameter_values, scan_reference_values, varargin)
%% plotMultiplePCAResults: Plots PCA results for multiple PCs
%
% Inputs:
% pcaResults - struct returned by computePCAfromImages
% scan_parameter_values, scan_reference_values
% varargin - name-value pairs (same as plotG2 plus 'FigNumRange','MaxPCToPlot')
%
% --- Parse name-value pairs ---
p = inputParser;
addParameter(p, 'XLabel', '', @(x) ischar(x) || isstring(x));
addParameter(p, 'FontName', 'Arial', @ischar);
addParameter(p, 'FontSize', 14, @isnumeric);
addParameter(p, 'Colormap', @Colormaps.coolwarm);
addParameter(p, 'SkipSaveFigures', false, @islogical);
addParameter(p, 'SaveDirectory', pwd, @ischar);
addParameter(p, 'FigNumRange', [], @(x) isnumeric(x) && all(x>0));
addParameter(p, 'MaxPCToPlot', 1, @(x) isnumeric(x) && isscalar(x) && x>=1);
parse(p, varargin{:});
opts = p.Results;
Nx = pcaResults.Nx;
Ny = pcaResults.Ny;
coeff = pcaResults.coeff;
score = pcaResults.score;
explained = pcaResults.explained;
raw_scan_param_vals = scan_parameter_values;
unique_scan_param_vals = scan_reference_values;
numGroups = numel(unique_scan_param_vals);
% --- Figure numbering setup ---
if isempty(opts.FigNumRange)
figCount = 1;
figNums = [];
else
figNums = opts.FigNumRange;
figCount = 1;
end
figPos = [100 100 950 750];
%% --- Precompute score norms and group by scan parameter ---
numPCsToPlot = min(opts.MaxPCToPlot, size(coeff,2));
scoreNorms = sqrt(sum(score(:,1:numPCsToPlot).^2, 2));
groupedNorms = arrayfun(@(g) scoreNorms(raw_scan_param_vals == g), unique_scan_param_vals, 'UniformOutput', false);
% Mean and SEM per group
meanNorms = cellfun(@mean, groupedNorms);
semNorms = cellfun(@(x) std(x)/sqrt(numel(x)), groupedNorms);
% Cumulants (up to 4th order) per group
kappas = cell2mat(cellfun(@(x) Calculator.computeCumulants(x(:),4), groupedNorms, 'UniformOutput', false));
%% --- Figure 1: PC images ---
if ~isempty(figNums)
fig = figure(figNums(figCount)); clf;
else
fig = figure; clf;
end
set(fig, 'Color', 'w', 'Position', figPos);
nRows = ceil(sqrt(numPCsToPlot));
nCols = ceil(numPCsToPlot/nRows);
tLayout = tiledlayout(nRows,nCols,'TileSpacing','compact','Padding','compact');
for pc = 1:numPCsToPlot
nexttile;
pc_image = reshape(coeff(:,pc), Nx, Ny);
imagesc(pc_image); axis image off;
colormap(opts.Colormap());
title(sprintf('PC%d (%.2f%%)', pc, explained(pc)), ...
'FontName', opts.FontName, 'FontSize', opts.FontSize);
end
sgtitle(sprintf('Principal Component Images (1-%d)', numPCsToPlot), ...
'FontName', opts.FontName, 'FontSize', opts.FontSize+2);
set(gca, 'FontName', opts.FontName, 'FontSize', opts.FontSize);
if ~opts.SkipSaveFigures
Plotter.saveFigure(fig, 'SaveFileName', sprintf('PC1to%d_Images.fig', numPCsToPlot), ...
'SaveDirectory', opts.SaveDirectory);
end
figCount = figCount + 1;
%% --- Figure 2: Mean ± SEM of score norms ---
if ~isempty(figNums)
fig = figure(figNums(figCount)); clf;
else
fig = figure; clf;
end
set(fig, 'Color', 'w', 'Position', figPos);
errorbar(unique_scan_param_vals, meanNorms, semNorms, '--o', 'LineWidth', 2);
xlabel(opts.XLabel, 'FontName', opts.FontName, 'FontSize', opts.FontSize);
ylabel(sprintf('Scores(1:%d) ± SEM', numPCsToPlot), 'FontName', opts.FontName, 'FontSize', opts.FontSize);
title('Mean ± SEM of Score Norms', 'FontName', opts.FontName, 'FontSize', opts.FontSize+2);
set(gca, 'FontName', opts.FontName, 'FontSize', opts.FontSize);
grid on;
if ~opts.SkipSaveFigures
Plotter.saveFigure(fig, 'SaveFileName', sprintf('PC1to%d_Norm_MeanSEM.fig', numPCsToPlot), ...
'SaveDirectory', opts.SaveDirectory);
end
figCount = figCount + 1;
%% --- Figure 3: Cumulants of score norms ---
if ~isempty(figNums)
fig = figure(figNums(figCount)); clf;
else
fig = figure; clf;
end
set(fig,'Color','w','Position',[100 100 950 750]);
t = tiledlayout(2,2,'TileSpacing','Compact','Padding','Compact');
title(t, sprintf('Cumulants of Score Norms (1-%d PCs)', numPCsToPlot), ...
'FontName', opts.FontName, 'FontSize', opts.FontSize+4);
cumulLabels = {'\kappa_1','\kappa_2','\kappa_3','\kappa_4'};
cumulTitles = {'Mean','Variance','Skewness','Binder Cumulant'};
for k = 1:4
ax = nexttile; hold(ax,'on');
plot(ax, unique_scan_param_vals, kappas(:, k), '-o', ...
'Color', [0.2 0.4 0.7], 'LineWidth', 2, 'MarkerSize', 8, ...
'MarkerFaceColor', [0.2 0.4 0.7]);
ylabel(ax, cumulLabels{k}, 'FontName', opts.FontName, 'FontSize', opts.FontSize);
xlabel(ax, opts.XLabel, 'FontName', opts.FontName, 'FontSize', opts.FontSize);
title(ax, cumulTitles{k}, 'FontName', opts.FontName, 'FontSize', opts.FontSize+2);
grid(ax,'on'); set(ax,'FontName',opts.FontName,'FontSize',opts.FontSize);
end
set(gca, 'FontName', opts.FontName, 'FontSize', opts.FontSize);
if ~opts.SkipSaveFigures
Plotter.saveFigure(fig, 'SaveFileName', sprintf('PC1to%d_Norm_Cumulants.fig', numPCsToPlot), ...
'SaveDirectory', opts.SaveDirectory);
end
end

View File

@ -1,13 +1,15 @@
function plotPCAResults(pcaResults, scan_parameter_values, scan_reference_values, varargin)
%% plotPCAResults: Plots PCA results in a style consistent with plotG2
function plotSinglePCAResults(pcaResults, scan_parameter_values, scan_reference_values, varargin)
%% plotPCAResults: Plots PCA results
%
% Inputs:
% pcaResults - struct returned by computePCAfromImages
% scan_parameter_values, scan_reference_values
% varargin - name-value pairs (same as plotG2 plus 'FigNumRange')
% varargin - name-value pairs (same as plotG2 plus 'FigNumRange','MaxPCToPlot')
%
% --- Parse name-value pairs ---
p = inputParser;
addParameter(p, 'XLabel', '', @(x) ischar(x) || isstring(x));
addParameter(p, 'FontName', 'Arial', @ischar);
addParameter(p, 'FontSize', 14, @isnumeric);
addParameter(p, 'Colormap', @Colormaps.coolwarm);
@ -67,7 +69,7 @@ function plotPCAResults(pcaResults, scan_parameter_values, scan_reference_values
idx = raw_scan_param_vals == unique_scan_param_vals(g);
scatter(repmat(unique_scan_param_vals(g), sum(idx),1), score(idx,1), 36, colors(g,:), 'filled');
end
xlabel('Control Parameter', 'FontName', opts.FontName, 'FontSize', opts.FontSize);
xlabel(opts.XLabel, 'FontName', opts.FontName, 'FontSize', opts.FontSize);
ylabel('PC1 Score', 'FontName', opts.FontName, 'FontSize', opts.FontSize);
title('Evolution of PC1 Scores', 'FontName', opts.FontName, 'FontSize', opts.FontSize + 2);
grid on;
@ -132,7 +134,7 @@ function plotPCAResults(pcaResults, scan_parameter_values, scan_reference_values
% Plot boxplot with categorical groups
boxplot(score(:,1), groupCats);
xlabel('Control Parameter', 'FontName', opts.FontName, 'FontSize', opts.FontSize);
xlabel(opts.XLabel, 'FontName', opts.FontName, 'FontSize', opts.FontSize);
ylabel('PC1 Score', 'FontName', opts.FontName, 'FontSize', opts.FontSize);
title('PC1 Score Boxplots by Group', 'FontName', opts.FontName, 'FontSize', opts.FontSize + 2);
grid on;
@ -152,8 +154,8 @@ function plotPCAResults(pcaResults, scan_parameter_values, scan_reference_values
set(fig, 'Color', 'w', 'Position', figPos);
meanScores = arrayfun(@(g) mean(score(raw_scan_param_vals == g,1)), unique_scan_param_vals);
semScores = arrayfun(@(g) std(score(raw_scan_param_vals == g,1))/sqrt(sum(raw_scan_param_vals == g)), unique_scan_param_vals);
errorbar(unique_scan_param_vals, meanScores, semScores, '-o', 'LineWidth', 2);
xlabel('Control Parameter', 'FontName', opts.FontName, 'FontSize', opts.FontSize);
errorbar(unique_scan_param_vals, meanScores, semScores, '--o', 'LineWidth', 2);
xlabel(opts.XLabel, 'FontName', opts.FontName, 'FontSize', opts.FontSize);
ylabel('Mean PC1 Score ± SEM', 'FontName', opts.FontName, 'FontSize', opts.FontSize);
title('Mean ± SEM of PC1 Scores', 'FontName', opts.FontName, 'FontSize', opts.FontSize + 2);
grid on;
@ -163,29 +165,35 @@ function plotPCAResults(pcaResults, scan_parameter_values, scan_reference_values
end
figCount = figCount + 1;
%% --- Figure 6: PC1 Scores Distribution Binder Cumulant ---
cumulantsAll = cell2mat(arrayfun(@(g) {Calculator.computeCumulants(score(raw_scan_param_vals == g,1), 4)}, unique_scan_param_vals));
cumulantsAll = reshape(cumulantsAll, 4, numGroups);
binderVals = cumulantsAll(4,:);
%% --- Figure 6: PC1 Scores Distribution Cumulants ---
kappas = cell2mat(arrayfun(@(g) {Calculator.computeCumulants(score(raw_scan_param_vals == g,1), 4)}, unique_scan_param_vals));
if ~isempty(figNums)
fig = figure(figNums(figCount)); clf;
else
fig = figure; clf;
end
set(fig, 'Color', 'w', 'Position', figPos);
plot(unique_scan_param_vals, binderVals*1E-5, '-o', 'LineWidth', 2); % scale like older code
xlabel('Control Parameter', 'FontName', opts.FontName, 'FontSize', opts.FontSize);
ylabel('\kappa (\times 10^5)', 'FontName', opts.FontName, 'FontSize', opts.FontSize);
title('Binder Cumulant of PC1 Scores', 'FontName', opts.FontName, 'FontSize', opts.FontSize + 2);
grid on;
set(fig,'Color','w','Position',[100 100 950 750]);
t = tiledlayout(2,2,'TileSpacing','Compact','Padding','Compact');
title(t, 'Cumulants of PC1 Scores', ...
'FontName', opts.FontName, 'FontSize', opts.FontSize+4);
cumulLabels = {'\kappa_1','\kappa_2','\kappa_3','\kappa_4'};
cumulTitles = {'Mean','Variance','Skewness','Binder Cumulant'};
for k = 1:4
ax = nexttile; hold(ax,'on');
plot(ax, unique_scan_param_vals, kappas(:, k), '-o', ...
'Color', [0.2 0.4 0.7], 'LineWidth', 2, 'MarkerSize', 8, ...
'MarkerFaceColor', [0.2 0.4 0.7]);
ylabel(ax, cumulLabels{k}, 'FontName', opts.FontName, 'FontSize', opts.FontSize);
xlabel(ax, opts.XLabel, 'FontName', opts.FontName, 'FontSize', opts.FontSize);
title(ax, cumulTitles{k}, 'FontName', opts.FontName, 'FontSize', opts.FontSize+2);
grid(ax,'on'); set(ax,'FontName',opts.FontName,'FontSize',opts.FontSize);
end
set(gca, 'FontName', opts.FontName, 'FontSize', opts.FontSize);
if ~opts.SkipSaveFigures
Plotter.saveFigure(fig, 'SaveFileName', 'PC1_BinderCumulant.fig', 'SaveDirectory', opts.SaveDirectory);
end
%% --- ANOVA Test ---
p = anova1(score(:,1), groupLabels, 'off');
fprintf('[INFO] ANOVA p-value for PC1 score differences between groups: %.4e\n', p);
end

View File

@ -219,28 +219,34 @@ Plotter.plotCumulants(scan_reference_values, ...
'XLabel', 'B (G)', ...
'FigNum', 11, ...
'FontName', options.font, ...
'MarkerSize', 6, ...
'LineWidth', 1.5, ...
'SkipSaveFigures', options.skipSaveFigures, ...
'SaveFileName', 'CumulantOfPeakOffsetAngularCorrelation.fig', ...
'SaveDirectory', figSaveDir);
%%
%{
%% ------------------ 6. PCA ------------------
Plotter.plotPCAResults(compiled_results.pca_results, scan_parameter_values, scan_reference_values, ...
Plotter.plotSinglePCAResults(compiled_results.pca_results, scan_parameter_values, scan_reference_values, ...
'FigNumRange', [12,13,14,15,16,17], ...
'XLabel', 'B (G)', ...
'FontName', options.font, ...
'SkipSaveFigures', options.skipSaveFigures, ...
'SaveDirectory', figSaveDir);
Plotter.plotMultiplePCAResults(compiled_results.pca_results, scan_parameter_values, scan_reference_values, ...
'MaxPCToPlot', 2, ...
'XLabel', 'B (G)', ...
'FigNumRange', [18,19,20], ...
'FontName', options.font, ...
'SkipSaveFigures', options.skipSaveFigures, ...
'SaveDirectory', figSaveDir);
%{
%% ------------------ 7. Average of Spectra Plots ------------------
Plotter.plotAverageSpectra(scan_parameter_values, ...
spectral_analysis_results, ...
'ScanParameterName', scan_parameter, ...
'FigNum', 18, ...
'FigNum', 21, ...
'ColormapPS', Colormaps.coolwarm(), ...
'Font', 'Bahnschrift', ...
'SaveFileName', 'avgSpectra.fig', ...

View File

@ -163,31 +163,37 @@ Plotter.plotPDF(compiled_results.custom_g_results.max_g2_all_per_scan_parameter_
Plotter.plotCumulants(scan_reference_values, ...
{compiled_results.custom_g_results.mean_max_g2, compiled_results.custom_g_results.var_max_g2, compiled_results.custom_g_results.skew_max_g2_angle, compiled_results.custom_g_results.fourth_order_cumulant_max_g2}, ...
'Title', 'Cumulants of Peak Offset Angular Correlation', ...
'XLabel', 'B (G)', ...
'XLabel', '\alpha (degrees)', ...
'FigNum', 10, ...
'FontName', options.font, ...
'MarkerSize', 6, ...
'LineWidth', 1.5, ...
'SkipSaveFigures', options.skipSaveFigures, ...
'SaveFileName', 'CumulantOfPeakOffsetAngularCorrelation.fig', ...
'SaveDirectory', figSaveDir);
%%
%{
%% ------------------ 6. PCA ------------------
Plotter.plotPCAResults(compiled_results.pca_results, scan_parameter_values, scan_reference_values, ...
Plotter.plotSinglePCAResults(compiled_results.pca_results, scan_parameter_values, scan_reference_values, ...
'FigNumRange', [11,12,13,14,15,16], ...
'XLabel', '\alpha (degrees)', ...
'FontName', options.font, ...
'SkipSaveFigures', options.skipSaveFigures, ...
'SaveDirectory', figSaveDir);
Plotter.plotMultiplePCAResults(compiled_results.pca_results, scan_parameter_values, scan_reference_values, ...
'MaxPCToPlot', 2, ...
'XLabel', '\alpha (degrees)', ...
'FigNumRange', [17,18,19], ...
'FontName', options.font, ...
'SkipSaveFigures', options.skipSaveFigures, ...
'SaveDirectory', figSaveDir);
%{
%% ------------------ 7. Average of Spectra Plots ------------------
Plotter.plotAverageSpectra(scan_parameter_values, ...
spectral_analysis_results, ...
'ScanParameterName', scan_parameter, ...
'FigNum', 17, ...
'FigNum', 20, ...
'ColormapPS', Colormaps.coolwarm(), ...
'Font', 'Bahnschrift', ...
'SaveFileName', 'avgSpectra.fig', ...

View File

@ -213,35 +213,41 @@ Plotter.plotPDF(compiled_results.custom_g_results.max_g2_all_per_scan_parameter_
'XLim', [min(scan_reference_values) max(scan_reference_values)]);
%% ------------------ 6. Cumulants across transition ------------------
%% ------------------ 5. Cumulants across transition ------------------
Plotter.plotCumulants(scan_reference_values, ...
{compiled_results.custom_g_results.mean_max_g2, compiled_results.custom_g_results.var_max_g2, compiled_results.custom_g_results.skew_max_g2_angle, compiled_results.custom_g_results.fourth_order_cumulant_max_g2}, ...
'Title', 'Cumulants of Peak Offset Angular Correlation', ...
'XLabel', 'B (G)', ...
'FigNum', 11, ...
'FontName', options.font, ...
'MarkerSize', 6, ...
'LineWidth', 1.5, ...
'SkipSaveFigures', options.skipSaveFigures, ...
'SaveFileName', 'CumulantOfPeakOffsetAngularCorrelation.fig', ...
'SaveDirectory', figSaveDir);
%%
%{
%% ------------------ 7. PCA ------------------
Plotter.plotPCAResults(compiled_results.pca_results, scan_parameter_values, scan_reference_values, ...
%% ------------------ 6. PCA ------------------
Plotter.plotSinglePCAResults(compiled_results.pca_results, scan_parameter_values, scan_reference_values, ...
'FigNumRange', [12,13,14,15,16,17], ...
'XLabel', 'B (G)', ...
'FontName', options.font, ...
'SkipSaveFigures', options.skipSaveFigures, ...
'SaveDirectory', figSaveDir);
%% ------------------ 8. Average of Spectra Plots ------------------
Plotter.plotMultiplePCAResults(compiled_results.pca_results, scan_parameter_values, scan_reference_values, ...
'MaxPCToPlot', 2, ...
'XLabel', 'B (G)', ...
'FigNumRange', [18,19,20], ...
'FontName', options.font, ...
'SkipSaveFigures', options.skipSaveFigures, ...
'SaveDirectory', figSaveDir);
%{
%% ------------------ 7. Average of Spectra Plots ------------------
Plotter.plotAverageSpectra(scan_parameter_values, ...
spectral_analysis_results, ...
'ScanParameterName', scan_parameter, ...
'FigNum', 18, ...
'FigNum', 21, ...
'ColormapPS', Colormaps.coolwarm(), ...
'Font', 'Bahnschrift', ...
'SaveFileName', 'avgSpectra.fig', ...

View File

@ -164,31 +164,37 @@ Plotter.plotPDF(compiled_results.custom_g_results.max_g2_all_per_scan_parameter_
Plotter.plotCumulants(scan_reference_values, ...
{compiled_results.custom_g_results.mean_max_g2, compiled_results.custom_g_results.var_max_g2, compiled_results.custom_g_results.skew_max_g2_angle, compiled_results.custom_g_results.fourth_order_cumulant_max_g2}, ...
'Title', 'Cumulants of Peak Offset Angular Correlation', ...
'XLabel', 'B (G)', ...
'XLabel', '\alpha (degrees)', ...
'FigNum', 10, ...
'FontName', options.font, ...
'MarkerSize', 6, ...
'LineWidth', 1.5, ...
'SkipSaveFigures', options.skipSaveFigures, ...
'SaveFileName', 'CumulantOfPeakOffsetAngularCorrelation.fig', ...
'SaveDirectory', figSaveDir);
%%
%{
%% ------------------ 6. PCA ------------------
Plotter.plotPCAResults(compiled_results.pca_results, scan_parameter_values, scan_reference_values, ...
Plotter.plotSinglePCAResults(compiled_results.pca_results, scan_parameter_values, scan_reference_values, ...
'FigNumRange', [11,12,13,14,15,16], ...
'XLabel', '\alpha (degrees)', ...
'FontName', options.font, ...
'SkipSaveFigures', options.skipSaveFigures, ...
'SaveDirectory', figSaveDir);
Plotter.plotMultiplePCAResults(compiled_results.pca_results, scan_parameter_values, scan_reference_values, ...
'MaxPCToPlot', 2, ...
'XLabel', '\alpha (degrees)', ...
'FigNumRange', [17,18,19], ...
'FontName', options.font, ...
'SkipSaveFigures', options.skipSaveFigures, ...
'SaveDirectory', figSaveDir);
%{
%% ------------------ 7. Average of Spectra Plots ------------------
Plotter.plotAverageSpectra(scan_parameter_values, ...
spectral_analysis_results, ...
'ScanParameterName', scan_parameter, ...
'FigNum', 17, ...
'FigNum', 20, ...
'ColormapPS', Colormaps.coolwarm(), ...
'Font', 'Bahnschrift', ...
'SaveFileName', 'avgSpectra.fig', ...