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)
更新:
要默認使用這樣一套(GCA, 'XTickLabelMode', '汽車'),集(GCA, 'XTickMode', '汽車')
說明:How to reset XTickLabel to default
[This information](http://www.mathworks.es/es/help/matlab/creating_plots/setting-default-property-values.html#brb8fc3)可能有幫助 –
我發現我的方法是正確,但XTickLabel似乎不是一個對象類型,這就是爲什麼它不起作用。 – Lisa
路易斯,感謝您的提示。我已經在那個網站上,但最初是以錯誤的方式實施的。 – Lisa