fix(matlab): rate 0.02 grid, batch 3
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 45 KiB |
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user