From 812849504953f5ec264adb9d8184f2f8885d93a3 Mon Sep 17 00:00:00 2001 From: Experiments DB Dev Date: Fri, 24 Jul 2026 10:37:09 -0400 Subject: [PATCH] fix(matlab): rate y-grid every 0.02 (was auto-subdividing to ~0.01) MATLAB's minor grid ignored MinorTickValues and auto-subdivided finer than 0.02. Make 0.02 the actual (major) tick spacing for rate, label only every 0.1, and let grid on draw the fine 0.02 gridlines deterministically. Regenerated all figures. Co-Authored-By: Claude Opus 4.8 --- analysis/matlab/variation_plot.m | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/analysis/matlab/variation_plot.m b/analysis/matlab/variation_plot.m index a9dba8b..adeedd6 100644 --- a/analysis/matlab/variation_plot.m +++ b/analysis/matlab/variation_plot.m @@ -54,12 +54,20 @@ if strcmp(metric, 'count') % count: tick every 5, but label only every 10 if mod(yt(k), 10) == 0; lbl{k} = num2str(yt(k)); else; lbl{k} = ''; end end set(gca, 'YTick', yt, 'YTickLabel', lbl); -else % rate: fine minor tick marks every 0.02 (no labels) +else % rate: tick every 0.02, label only every 0.1 yl = ylim(gca); - set(gca, 'YMinorTick', 'on'); - ax = gca; ax.YAxis.MinorTickValues = 0 : 0.02 : ceil(yl(2) / 0.02) * 0.02; + yt = 0 : 0.02 : ceil(yl(2) / 0.02) * 0.02; + lbl = cell(1, numel(yt)); + for k = 1:numel(yt) + if abs(yt(k) / 0.1 - round(yt(k) / 0.1)) < 1e-9 % multiple of 0.1 + lbl{k} = num2str(round(yt(k), 1)); + else + lbl{k} = ''; + end + end + set(gca, 'YTick', yt, 'YTickLabel', lbl); end -grid on +grid on % gridlines fall on the ticks (rate: every 0.02) % Add breathing room between the y-axis label and the tick numbers. set(ylh, 'Units', 'normalized'); yp = get(ylh, 'Position');