Files
MPKFNet/show.py
T
2021-09-15 11:33:58 +08:00

53 lines
1.8 KiB
Python
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import matplotlib.pyplot as plt
# -*- coding: UTF-8 -*-
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
# 这里导入你自己的数据
# ......
# ......
# x_axix,train_pn_dis这些都是长度相同的list()
MAE=[42.124,40.244,30.196,29.367,28.168,26.955,26.135,25.254,23.277,24.866,35.236]
MSE = [88.121,87.788,85.822,56.258,63.689,54.101,53.936,47.517,44.022,52.201,79.654]
x=[0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,0.95,1.0]
# MAE=[25.622,25.245,24.568,24.121,23.689,23.277,24.248,26.498,26.875,27.012,27.232]
# MSE = [53.414,52.654,50.864,48.871,46.856,44.022,48.572,55.913,56.248,56.875,56.921]
# x=[0.1,0.09,0.08,0.07,0.06,0.05,0.04,0.03,0.02,0.01,0]
#plt.title('Ablation study of the loss ratio about heads')
# 开始画图
sub_axix = filter(lambda x: x % 200 == 0, x)
plt.title('Ablation study of the loss ratio about backbone',fontsize=16)
plt.plot(x, MAE, color='green', label='MAE')
plt.plot(x, MSE, color='red', label='MSE')
plt.xticks(fontsize=12)
plt.yticks(fontsize=12)
plt.xlabel(...,fontsize=16)
plt.ylabel(...,fontsize=16)
plt.legend() # 显示图例
plt.xlabel('Loss weigh of backbone')
#plt.ylabel('rate')
plt.show()
# python 一个折线图绘制多个曲线
# ......
# x_axix,train_pn_dis这些都是长度相同的list()
# 开始画图
# sub_axix = filter(lambda x: x % 200 == 0, x_axix)
# plt.title('Result Analysis')
# plt.plot(x_axix, train_acys, color='green', label='training accuracy')
# plt.plot(sub_axix, test_acys, color='red', label='testing accuracy')
# plt.plot(x_axix, train_pn_dis, color='skyblue', label='PN distance')
# plt.plot(x_axix, thresholds, color='blue', label='threshold')
# plt.legend() # 显示图例
#
# plt.xlabel('iteration times')
# plt.ylabel('rate')
# plt.show()
# plt.plot(x, squares)
# plt.show()