Draw Plot with matplotlib

March 26, 2014   

matplotlib is a Python package for drawing plot.

#!/usr/bin/env python
from pylab import *
from matplotlib import pyplot

time = (0, 2, 7)
count = (2, 4, 10)

pyplot.plot(time, count)
pyplot.axis(0, 24, 0, 10)

xlabel('Time (s)')
ylabel('Count (integer)')
title('Example of counts')
grid(True)
savefig("test.png")
#show()

Ref: http://matplotlib.org/



comments powered by Disqus