import matplotlib.pyplot as plt with open('delays.log') as file: log = [float(x) for x in file.readlines()] TIME = log.pop(0) DELTA_T = log.pop(0) fig2 = plt.figure() ax2 = fig2.subplots() ax2.set_title("Duration Log (T = {:.2f}, dt = {:.2f})".format(TIME, DELTA_T)) ax2.set_xlabel("Iterations") ax2.set_ylabel("Time") # ax2.plot([-1, len(log)], [DELTA_T, DELTA_T], c='red') # ax2.plot([-1, len(log)], [0.01, 0.01], c='green') ax2.bar(range(len(log)), log) plt.show()