MATLAB sets specific defaults

Is there a way to set very specific default properties for font fonts and distinguish between tick font size, label font size, header font size, etc.?

I know that I can set the default font properties to

set(0, 'DefaultAxesFontSize',14)
set(0, 'DefaultAxesFontWeight','bold')

But I'm looking for something like:

set(0, 'DefaultXTickLabelFontSize',10)
set(0, 'DefaultLegendFontSize',12)
% etc..

That would be very convenient. Thanks for any help!

+4
source share
1 answer
clear all
close all

X=rand(10,1);
Y=rand(10,1);

figure(1)
plot(X,Y)
title('This is a figure','interpreter','latex','FontSize',30);
whitebg([1,0.89063,0.87891]) % Background
set(gca,'FontSize',21); % Font size
set(gca,'YTick',[0 0.2 0.4 0.6 0.8 1])
set(gca,'XTick',[0 0.2 0.4 0.6 0.8 1])
set(gca,'XColor',[0.38,0.10,0.10]) %Color of the axis X
set(gca,'YColor',[0.38,0.10,0.10]) %Color of the axis Y
xlabel('x','interpreter','latex','FontSize',30); % Using for instance latex fonts
ylabel('y','interpreter','latex','FontSize',30);
set(gca,'LineWidth',3)

Update:

By default, use something like this set (gca, 'XTickLabelMode', 'auto'), set (gca, 'XTickMode', 'auto')

Explanation: How to reset XTickLabel to default

+1
source

Source: https://habr.com/ru/post/1526942/


All Articles