Skip to content

Instantly share code, notes, and snippets.

@ivder
Created February 13, 2020 04:16
Show Gist options
  • Save ivder/014780bf7f569c40723944504dacb63b to your computer and use it in GitHub Desktop.
Save ivder/014780bf7f569c40723944504dacb63b to your computer and use it in GitHub Desktop.
Graph data representation using matplotlib
import matplotlib.pyplot as plt
from matplotlib.pyplot import figure
figure(num=None, figsize=(45, 6), dpi=80, facecolor='w', edgecolor='k')
def process(mypath):
cols = []
xlist=[]
f= open(mypath,"r")
lines = f.readlines()
for line in lines:
cols.append(line.split('\t')[0])
cols = [float(col) for col in cols]
for x in range (363):
xlist.append(x)
plt.plot(xlist,cols, 'ro')
#plt.savefig('test.png')
plt.show()
if __name__ == '__main__':
mypath = "G:/save.txt"
process(mypath)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment