diff --git a/analysis/matlab/variation_plot.m b/analysis/matlab/variation_plot.m index 1f090e6..a9dba8b 100644 --- a/analysis/matlab/variation_plot.m +++ b/analysis/matlab/variation_plot.m @@ -46,9 +46,18 @@ set(gca, 'XTick', xd, 'XTickLabel', {}, 'Position', [0.2 0.30 0.60 0.60], ... xticklabels('auto') set(gca, 'XTickLabelRotation', 0); % keep x labels horizontal (no auto-rotate) xlim([min(xd) - 0.5, max(xd) + 0.5]); % half-day padding so points aren't on the edges -if strcmp(metric, 'count') % success count: y-ticks every 5 units +if strcmp(metric, 'count') % count: tick every 5, but label only every 10 yl = ylim(gca); - set(gca, 'YTick', floor(yl(1) / 5) * 5 : 5 : ceil(yl(2) / 5) * 5); + yt = floor(yl(1) / 5) * 5 : 5 : ceil(yl(2) / 5) * 5; + lbl = cell(1, numel(yt)); + for k = 1:numel(yt) + 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) + yl = ylim(gca); + set(gca, 'YMinorTick', 'on'); + ax = gca; ax.YAxis.MinorTickValues = 0 : 0.02 : ceil(yl(2) / 0.02) * 0.02; end grid on % Add breathing room between the y-axis label and the tick numbers.