Guest User

Untitled

a guest
May 20th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. import matplotlib
  2. import matplotlib.pyplot as plt
  3.  
  4. class PlotData(object):
  5. """
  6. Takes an object and plots data into a graph
  7.  
  8. step 1: take row, column, filename
  9. step 2: plot a graph
  10. step 3: save graph into filename
  11. step 4: the name when called should display the image
  12.  
  13. """
  14.  
  15. def __init__(self, row, column, fname):
  16. self.row = row
  17. self.column = column
  18. self.fname = fname
  19.  
  20.  
  21. def __repr__(self):
  22. plt.plot(self.row, self.column) # plot graph using row & column
  23. plt.savefig(self.fname+'.png')
  24. return "%s.png" % (self.fname)
Add Comment
Please, Sign In to add comment