Advertisement
Welton

Gráficos com Python

Jul 25th, 2014
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. #import cvs and matplotlib libary
  2. import matplotlib.pyplot as plt
  3. import csv
  4.  
  5. listax = []
  6. listay = []
  7.  
  8. f = csv.reader(open('eggs.csv'), delimiter=',')
  9. for x,y in f:
  10.      listax.append(int(x))
  11.      listay.append(float(y))
  12.  
  13. #plotando dados
  14. plt.plot(listax, listay, linestyle="dashed", marker="o", color="green")
  15.  
  16. #configurando Eixo X
  17. plt.xlim(0.5,4.5)
  18. plt.xticks(listax)
  19.  
  20. #configurando Eixo Y
  21. plt.ylim(19.8,21.2)
  22. plt.yticks(listay)
  23.  
  24. #show plot
  25. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement