feat(matlab): count labels every 10 (ticks every 5); rate minor ticks every 0.02
variation_plot: count y-axis keeps 5-unit ticks/grid but labels only multiples of 10; rate y-axis adds tick-only minor marks every 0.02 (major labels stay at 0.2). Regenerated all figures. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -46,9 +46,18 @@ set(gca, 'XTick', xd, 'XTickLabel', {}, 'Position', [0.2 0.30 0.60 0.60], ...
|
|||||||
xticklabels('auto')
|
xticklabels('auto')
|
||||||
set(gca, 'XTickLabelRotation', 0); % keep x labels horizontal (no auto-rotate)
|
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
|
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);
|
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
|
end
|
||||||
grid on
|
grid on
|
||||||
% Add breathing room between the y-axis label and the tick numbers.
|
% Add breathing room between the y-axis label and the tick numbers.
|
||||||
|
|||||||
Reference in New Issue
Block a user