oquidave

matplotlib

May 10th, 2011
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. import matplotlib.pyplot as plot
  2.  
  3. #mtn
  4. count_mtn_list = getCount('mtn')#returns a list of mtn numbers
  5. #utl
  6. count_utl_list = getCount('utl')
  7. #warid
  8. count_warid_list = getCount('warid')
  9.  
  10. #x values
  11. dates_list = getDatesList('')#it doesn't matter which network here
  12. x = range(len(dates_list))
  13.  
  14. fig = plot.figure()
  15. ax1 = fig.add_subplot(211)
  16. ax1.plot(x, count_mtn_list, color='red')
  17.  
  18. ax2 = fig.add_subplot(212)
  19. ax2.plot(x, count_utl_list, color='blue')
  20.  
  21. ax3 = fig.add_subplot(213)
  22. ax3.plot(x, count_warid_list, color='green')
  23.  
  24. filename = "/home/oquidave/work/scripts/mt_revenue.png"
  25. plot.savefig(filename)
  26. plot.show()
  27.  
  28. TRACEBACK
  29.  
  30. Traceback (most recent call last):
  31. File "/home/oquidave/progs/eclipse/plugins/org.python.pydev.debug_1.5.7.2010050621/pysrc/pydevd.py", line 978, in <module>
  32. debugger.run(setup['file'], None, None)
  33. File "/home/oquidave/progs/eclipse/plugins/org.python.pydev.debug_1.5.7.2010050621/pysrc/pydevd.py", line 780, in run
  34. execfile(file, globals, locals) #execute the script
  35. File "/home/oquidave/workspace/python/ssh/mt_mtn.py", line 165, in <module>
  36. ax3 = fig.add_subplot(213)
  37. File "/usr/lib/python2.7/site-packages/matplotlib/figure.py", line 687, in add_subplot
  38. a = subplot_class_factory(projection_class)(self, *args, **kwargs)
  39. File "/usr/lib/python2.7/site-packages/matplotlib/axes.py", line 8377, in __init__
  40. self.update_params()
  41. File "/usr/lib/python2.7/site-packages/matplotlib/axes.py", line 8409, in update_params
  42. return_all=True)
  43. File "/usr/lib/python2.7/site-packages/matplotlib/gridspec.py", line 370, in get_position
  44. figBottom = figBottoms[rowNum]
  45. IndexError: list index out of range
Advertisement
Add Comment
Please, Sign In to add comment