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');