课题组matlab画图代码举例

xlabel('xlable name [unit]','FontWeight','bold','FontSize',18,...
    'FontName','Times New Roman');      %设置坐标轴字体大小和类型
ylabel('ylable name [unit]','FontWeight','bold','FontSize',18,...
    'FontName','Times New Roman');
set(gca,'FontWeight','bold','FontSize',14,'FontName','Times New Roman');   %设置坐标轴字体颜色
title('\fontsize{14}\bf title name');
set(gcf,'color','white')%设置背景颜色
box on
grid on

 xlim([0,20])  % x 和 y轴范围
 ylim([0,3])
%set(gca,'ytick',y)
set(gca,'xTickLabel',num2str(get(gca,'xtick')','%.3f')) % x 和 y轴刻度小数点位数
set(gca,'yTickLabel',num2str(get(gca,'ytick')','%.2f'))

set(gcf,'windowstyle','normal')
set(gcf,'Units','centimeters','Position',[6 6 14.5 12]);  %%设置图片大小和分辨率
%saveas(gcf,'C:\Users\Gejiuhao\Desktop\name.tif')           %%保存图片

print('-r300','-dtiffn','C:\Users\Gejiuhao\Desktop\name.tif');    %保存的图片名
saveas(gcf,'C:\Users\Gejiuhao\Desktop\name.fig')

Created: Jul 26, 2022 | 14:28