1、使用subplots画多个log.txt文件中的损失函数:
#!/usr/bin/env python
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
import math
import re
import pylab
from pylab import figure, show, legend
from mpl_toolkits.axes_grid1 import host_subplot
# read the log file
# fp = open('/home/subinyi/Users/DeFRCN-main/paper_image/log_1_uncertain.txt', 'r')
fp1 = open('C:/Users/Administrator/Desktop/log1.txt', 'r')
fp2 = open('C:/Users/Administrator/Desktop/log2.txt', 'r')
fp3 = open('C:/Users/Administrator/Desktop/log3.txt', 'r')
fp4 = open('C:/Users/Administrator/Desktop/log4.txt', 'r')
plt.figure(1)
fig, ax = plt.subplots(2,2)
train_iterations = []
train_loss = []
test_iterations