x=1:1:10;
y1=[1 2 3 1 2 3 1 2 3 5];
y2=[1 2 3 4 5 6 7 8 9 10];
linewidth_line=1.5;%线宽1.5
markersize=5;%标记大小
%MarkerIndices:标记间距
plot(x,y1,'-v','color',[1,0,0],'linewidth',linewidth_line,...
'markersize',markersize,'markerfacecolor',[1,0,0],'MarkerIndices',1:2:10);
hold on%hold on之后才能使一张图显示两条线
plot(x,y2,'-D','color',[48,151,164]/255,'linewidth',linewidth_line,...
'markersize',markersize,'markerfacecolor',[48,151,164]/255);
ylabel('Press/(Mpa)')%轴标签
xlabel('Time/(s)')
legend('load 1','load 2')%图例
legend box off%图例的框框,off关,on开
title('Transmation of the Load with the Time')%标题
set(gca,'FontName','Times New Roman','FontSize',12)%FontName:字体
box off;%控制图的框框
PictureResolution='-r800';%控制图片精度
set(gcf,'unit','centimeters','position',[5,5,12,9])%表示绘制的图为12×9cm,相对左下角位置为(5,5)
FileName='Picter1';%根据自己的需要修改
print('-djpeg',FileName,PictureResolution);
参考:UPAprilのVivyMatlab科研绘图基本操作_哔哩哔哩_bilibili
更多参数设置参看:MATLAB_figure绘图 - 知乎