# -*- coding: utf-8 -*- """ Created on Fri Feb 19 18:05:33 2021 @author: MB """ import numpy as np import matplotlib.pyplot as plt def loadfile(fileName, nline): #Read file with open(fileName, 'r') as f: cntnt = f.read() f.close #replace ',' by '.' cntnt = cntnt.replace(',', '.') # Split according to number of lines cntnt = cntnt.split('\n') #load data data = np.genfromtxt(cntnt, skip_header = nline, deletechars="~!@#$%^&*()-=+~\|]}[{': /?.><.") return data fileName="data" res = loadfile(fileName + '.txt', 0) cycle = np.array(res[:, 0], dtype = 'int') xData = res[:, 1]/100+1 yData = res[:, 2] plt.figure(1) plt.plot(xData,yData)