1. 程式人生 > 其它 >matlab 讀取mat檔案並繪圖及修改座標軸 圖例 新增標註

matlab 讀取mat檔案並繪圖及修改座標軸 圖例 新增標註

close all;
clear all;
clc;
%**注:直接執行將本檔案與匯出資料放置在同一資料夾執行,可得設定好的.fig檔案
%**選擇編輯-幅值圖窗即可圖片複製到word/visio等檔案中處理


m=load('1.mat');
a=m.DataExport.line_1.x;
b=m.DataExport.line_1.y;
figure(1)
plot (a,b,'Linewidth', 1.5,'MarkerFaceColor','r');%Times New Roman Helvetica
% text(16.5,250,'15.223','FontSize',14,'Fontname', '宋體','rotation',90)
% text(32,295,'檢測器A 250nm','FontSize',14,'Fontname', '宋體')%Times New Roman
xlabel('epoch');
ylabel('mAP');
title('Eval mAP');
legend('mAP');
set(gca,'FontSize',12,'Fontname', 'Helvetica');%字型字號大小設定
set(gcf,'unit','normalized','position',[0.1,0.1,0.4,0.5]);%圖窗位置大小設定
axis([0,155,0.69,0.925]);%座標範圍大小設定
set(gca,'XTick',0:20:155);

m=load('2.mat');
a=m.DataExport.line_1.x;
b=m.DataExport.line_1.y;
figure(2)
plot (a,b,'Linewidth', 1.5,'MarkerFaceColor','r');%Times New Roman Helvetica
% text(16.5,250,'15.223','FontSize',14,'Fontname', '宋體','rotation',90)
% text(32,295,'檢測器A 250nm','FontSize',14,'Fontname', '宋體')%Times New Roman
xlabel('epoch');
ylabel('mAP');
title('Eval mAP');
legend('mAP');
set(gca,'FontSize',12,'Fontname', 'Helvetica');%字型字號大小設定
set(gcf,'unit','normalized','position',[0.1,0.1,0.4,0.5]);%圖窗位置大小設定
axis([0,155,0.69,0.925]);%座標範圍大小設定
set(gca,'XTick',0:20:155);

m=load('3.mat');
a=m.DataExport.line_1.x;
b=m.DataExport.line_1.y;
figure(3)
plot (a,b,'Linewidth', 1.5,'MarkerFaceColor','r');%Times New Roman Helvetica
% text(16.5,250,'15.223','FontSize',14,'Fontname', '宋體','rotation',90)
% text(32,295,'檢測器A 250nm','FontSize',14,'Fontname', '宋體')%Times New Roman
xlabel('epoch');
ylabel('mAP');
title('Eval mAP');
legend('mAP');
set(gca,'FontSize',12,'Fontname', 'Helvetica');%字型字號大小設定
set(gcf,'unit','normalized','position',[0.1,0.1,0.4,0.5]);%圖窗位置大小設定
axis([0,155,0.69,0.925]);%座標範圍大小設定
set(gca,'XTick',0:20:155);