Created
February 13, 2020 04:16
-
-
Save ivder/014780bf7f569c40723944504dacb63b to your computer and use it in GitHub Desktop.
Graph data representation using matplotlib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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