Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib
- import matplotlib.pyplot as plt
- class PlotData(object):
- """
- Takes an object and plots data into a graph
- step 1: take row, column, filename
- step 2: plot a graph
- step 3: save graph into filename
- step 4: the name when called should display the image
- """
- def __init__(self, row, column, fname):
- self.row = row
- self.column = column
- self.fname = fname
- def __repr__(self):
- plt.plot(self.row, self.column) # plot graph using row & column
- plt.savefig(self.fname+'.png')
- return "%s.png" % (self.fname)
Add Comment
Please, Sign In to add comment