matlab绘图

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绘图 - 知乎

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值