analysis(matlab): add paper-style learning-curve plot to every variation

Add variation_plot.m + make_variation_plot.m, dropping plotcurve.m +
learning_curve.png into all 28 variation folders. Each figure plots mean +/-
SEM successful reaches per training day for the anodal/treatment group (red)
vs control (blue), in the style of the paper ("Lines indicate mean (and SEM)
across animals in the anodal (red) and control (blue) groups"). Per-group N is
read from the data and shown in the legend; training day is 1-indexed (our day
0 = paper Day 1). Headless via exportgraphics. prev_f_full reproduces the
paper's own figure (anodal N=12 vs control N=12).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Experiments DB Dev
2026-07-24 01:28:44 -04:00
parent 378ad6da05
commit a2a812acc8
58 changed files with 1681 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
function make_variation_plot()
%MAKE_VARIATION_PLOT Add a paper-style learning-curve figure to each variation.
% MAKE_VARIATION_PLOT() copies variation_plot.m into every variations/<name>/
% folder with a data.csv (as plotcurve.m) and runs it, producing
% learning_curve.png (mean +/- SEM successes per training day, anodal red vs
% control blue). Re-runnable; picks up new folders.
thisDir = fileparts(mfilename('fullpath'));
template = fullfile(thisDir, 'variation_plot.m');
root = fullfile(thisDir, 'variations');
d = dir(root);
n = 0;
for i = 1:numel(d)
if ~d(i).isdir || ismember(d(i).name, {'.', '..'}); continue; end
folder = fullfile(root, d(i).name);
if ~exist(fullfile(folder, 'data.csv'), 'file'); continue; end
copyfile(template, fullfile(folder, 'plotcurve.m'));
localRun(fullfile(folder, 'plotcurve.m'));
n = n + 1;
end
fprintf('\nAdded plotcurve.m + learning_curve.png to %d variation folders.\n', n);
end
function localRun(scriptPath)
run(scriptPath);
end