fix(matlab): force horizontal x labels + pad y-axis label
variation_plot: set XTickLabelRotation 0 after xticklabels('auto') so many-day
windows (e.g. unmerge_d0_10, 11 ticks) no longer auto-rotate to vertical; nudge
the y-axis label left for breathing room from the tick numbers. Regenerated all
learning-curve figures.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -36,7 +36,7 @@ e2 = errorbar(xd, Mc, Sc, '-o', 'Color', blue, 'MarkerFaceColor', blue, 'LineWid
|
|||||||
hold off
|
hold off
|
||||||
legend([e1 e2], {sprintf('anodal, N = %d', na), sprintf('control, N = %d', nc)}, ...
|
legend([e1 e2], {sprintf('anodal, N = %d', na), sprintf('control, N = %d', nc)}, ...
|
||||||
'Location', 'northwest', 'Box', 'off');
|
'Location', 'northwest', 'Box', 'off');
|
||||||
xlabel('training day'); ylabel(ylab);
|
xlabel('training day'); ylh = ylabel(ylab);
|
||||||
title(vname, 'Interpreter', 'none');
|
title(vname, 'Interpreter', 'none');
|
||||||
% Compact publication layout with a tight centred plot box and ticks pointing
|
% Compact publication layout with a tight centred plot box and ticks pointing
|
||||||
% out. Setting XTickLabel {} then xticklabels('auto') resets the labels cleanly
|
% out. Setting XTickLabel {} then xticklabels('auto') resets the labels cleanly
|
||||||
@@ -44,11 +44,16 @@ title(vname, 'Interpreter', 'none');
|
|||||||
set(gca, 'XTick', xd, 'XTickLabel', {}, 'Position', [0.2 0.30 0.60 0.60], ...
|
set(gca, 'XTick', xd, 'XTickLabel', {}, 'Position', [0.2 0.30 0.60 0.60], ...
|
||||||
'FontName', 'Arial', 'FontSize', 13, 'LineWidth', 1.5, 'Box', 'off', 'TickDir', 'out');
|
'FontName', 'Arial', 'FontSize', 13, 'LineWidth', 1.5, 'Box', 'off', 'TickDir', 'out');
|
||||||
xticklabels('auto')
|
xticklabels('auto')
|
||||||
|
set(gca, 'XTickLabelRotation', 0); % keep x labels horizontal (no auto-rotate)
|
||||||
if strcmp(metric, 'count') % success count: y-ticks every 5 units
|
if strcmp(metric, 'count') % success count: y-ticks every 5 units
|
||||||
yl = ylim(gca);
|
yl = ylim(gca);
|
||||||
set(gca, 'YTick', floor(yl(1) / 5) * 5 : 5 : ceil(yl(2) / 5) * 5);
|
set(gca, 'YTick', floor(yl(1) / 5) * 5 : 5 : ceil(yl(2) / 5) * 5);
|
||||||
end
|
end
|
||||||
grid on
|
grid on
|
||||||
|
% Add breathing room between the y-axis label and the tick numbers.
|
||||||
|
set(ylh, 'Units', 'normalized');
|
||||||
|
yp = get(ylh, 'Position');
|
||||||
|
set(ylh, 'Position', [yp(1) - 0.06, yp(2), 0]);
|
||||||
drawnow;
|
drawnow;
|
||||||
exportgraphics(fig, outFile, 'Resolution', 150);
|
exportgraphics(fig, outFile, 'Resolution', 150);
|
||||||
close(fig);
|
close(fig);
|
||||||
|
|||||||
Reference in New Issue
Block a user