Chinaunix首页 | 论坛 | 博客
  • 博客访问: 23638
  • 博文数量: 20
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 207
  • 用 户 组: 普通用户
  • 注册时间: 2013-08-26 09:51
文章分类

全部博文(20)

分类: Python/Ruby

2013-09-16 12:53:23

更多参考http://www.cnblogs.com/wei-li/archive/2012/05/23/2506940.html


  1. import matplotlib.pyplot as plt

  2. fig1 = plt.figure(1)
  3. plt.subplot(211)
  4. y = [30, 23, 10]
  5. x = [14,15,16]
  6. plt.plot(x, y,'r')
  7. plt.xlabel('times')
  8. plt.ylabel('numbers')

  9. plt.subplot(212)
  10. y = [40, 26, 13]
  11. plt.plot(x, y,'--b')
  12. plt.xlabel('times')
  13. plt.ylabel('numbers')
  14. plt.show()

 

  1. import matplotlib.pyplot as plt

  2. fig1 = plt.figure(1)
  3. plt.subplot(211)
  4. y = [30, 23, 10]
  5. x = [14,15,16]
  6. plt.plot(x, y,'r')
  7. y = [40, 17, 8]
  8. plt.plot(x, y,'--y')
  9. plt.xlabel('times')
  10. plt.ylabel('numbers')

  11. plt.subplot(212)
  12. y = [40, 26, 13]
  13. plt.plot(x, y,'--b')
  14. plt.xlabel('times')
  15. plt.ylabel('numbers')
  16. plt.show()




  1. import matplotlib.pyplot as plt
  2. from pylab import *
  3. from datetime import *

  4. x = []
  5. d = date(2013,4,10)
  6. x.append(d)
  7. d = date(2013,4,11)
  8. x.append(d)
  9. d = date(2013,4,12)
  10. x.append(d)
  11. d = date(2013,4,13)
  12. x.append(d)
  13. d = date(2013,4,14)
  14. x.append(d)
  15. d = date(2013,4,15)
  16. x.append(d)
  17. d = date(2013,4,16)
  18. x.append(d)
  19. d = date(2013,4,17)
  20. x.append(d)


  21. fig = plt.figure()
  22. fig.suptitle('Burndown Chart')
  23. ax = fig.add_subplot(211)
  24. ax.xaxis.set_major_formatter( DateFormatter('%m/%d') )
  25. ax.grid(True)
  26. y = [48,44,40,32,28,20,10,2]
  27. ax.plot(x, y,'r',linewidth=2)
  28. y = [50, 43, 36,29,22,15,8,0]
  29. plt.plot(x, y,'--y',linewidth=2)
  30. plt.xlabel('date')
  31. plt.ylabel('hours(Fu Weijia)')

  32. ax = fig.add_subplot(212)
  33. ax.xaxis.set_major_formatter( DateFormatter('%m/%d') )
  34. ax.grid(True)
  35. y = [100, 81, 72,67,60,40,32,10]
  36. plt.plot(x, y,'--b',linewidth=2)
  37. plt.xlabel('date')
  38. plt.ylabel('hours(All Members)')

  39. plt.show()

阅读(567) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~