% Regenerate all PNG figures under images/.

thisdir = fileparts(mfilename('fullpath'));
addpath(genpath(fullfile(thisdir,'..','src')));
addpath(thisdir);

scripts = {'plot_logical_vs_p', ...
           'plot_syndrome_hist', ...
           'plot_confusion', ...
           'plot_error_weight', ...
           'run_bitflip_demo', ...
           'plot_code_recovery_comparison', ...
           'plot_depolarizing_sweep', ...
           'plot_noisy_syndrome_rounds', ...
           'plot_surface3_logical_vs_p', ...
           'plot_surface3_channel_comparison', ...
           'plot_surface3_noisy_syndrome_rounds', ...
           'plot_surface_distance_scaling'};

for k = 1:numel(scripts)
    fprintf('Running %s...\n', scripts{k});
    feval(scripts{k});
    close all;
end

disp('All plots regenerated.');
