Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. import matplotlib.pyplot as plt
  2. import numpy as np
  3. import pandas as pd
  4.  
  5. class data_graphs:
  6. def __init__(self, filename):
  7. self.data = pd.read_csv(filename, delim_whitespace = True, header = None)
  8. self.x1 = self.data[1]
  9. self.x2 = self.data[2]
  10. self.y1 = self.data[3]
  11. self.filename = filename
  12.  
  13.  
  14. def graph_x1(self):
  15. self.x1_fig = plt.figure()
  16. plt.plot(self.x1.as_matrix(), self.y1.as_matrix())
  17. plt.title(self.filename)
  18. plt.show()
  19.  
  20. def graph_x2(self):
  21. self.x2_fig = plt.figure()
  22. plt.plot(self.x2.as_matrix(), self.y1.as_matrix())
  23. plt.title(self.filename)
  24. plt.show()
  25.  
  26.  
  27. graphs = []
  28.  
  29. for i in range(1):
  30. filename = "dn%02d.txt"%(i+1)
  31. print(filename)
  32. graphs.append(data_graphs(filename))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement