使用函数:
plot (绘图);set(设置坐标属性);print(输出图片)
代码如下:
X = 1:9;
Y = 10:10:90;
f2 = figure(2);
set(gcf,'unit','centimeters','position',[0,0,8,6])
plot(X,Y,'-ok','LineWidth',1,'MarkerSize',5,'MarkerFaceColor','k')
set(gca,'FontName', 'Times New Roman', 'FontSize', 8, 'LineWidth', 1, 'ytick', 300:300:900, 'xtick',2:2:8, 'xlim', [0,10] ,'ylim', [0,100]);
set(gca,'looseInset',[0 0 0 0]) % 去除图片白色边框
xlabel('x zhou','FontName', 'Times New Roman','FontSize', 10)
ylabel('yzhou','FontName', 'Times New Roman','FontSize', 10)
title('biaoti','FontName', 'Times New Roman','FontSize', 10)
annotation(f2,'textbox',[0.05 0.83 0.1 0.1], 'String','(a)', 'FontSize',10,'FontName','Times New Roman','EdgeColor','none');
fullname = ['C:\Users\WangYonglin\Desktop\','折线图','.tif']
print('-dtiff','-r600',fullname)
说明:
gcf : Current figure handle(当前图像句柄)
本文为了简便, 配合set使用.
还可以使用下面写法:

本文介绍如何使用Matlab进行二维折线图的绘制,并详细解释了设置坐标轴属性、字体样式、图片尺寸及保存格式的方法。
4323

被折叠的 条评论
为什么被折叠?



