Advertisement
oquidave

matplotlib

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