Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib.pyplot as plt
- import numpy as np
- import pandas as pd
- class data_graphs:
- def __init__(self, filename):
- self.data = pd.read_csv(filename, delim_whitespace = True, header = None)
- self.x1 = self.data[1]
- self.x2 = self.data[2]
- self.y1 = self.data[3]
- self.filename = filename
- def graph_x1(self):
- self.x1_fig = plt.figure()
- plt.plot(self.x1.as_matrix(), self.y1.as_matrix())
- plt.title(self.filename)
- plt.show()
- def graph_x2(self):
- self.x2_fig = plt.figure()
- plt.plot(self.x2.as_matrix(), self.y1.as_matrix())
- plt.title(self.filename)
- plt.show()
- graphs = []
- for i in range(1):
- filename = "dn%02d.txt"%(i+1)
- print(filename)
- graphs.append(data_graphs(filename))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement