Creating a histogram plot with python
from matplotlib import pyplot
filename = 'times_1201.txt'
lines = open(filename).readlines()
x = [int(line.strip()) for line in lines]
bins = [i * 1000 for i in range(10)]
pyplot.hist(x, bins=bins, facecolor='green', alpha=0.75)
pyplot.xlabel('Time (ms)')
pyplot.ylabel('Count')
pyplot.suptitle(r'Sup title')
pyplot.title(r'Title')
pyplot.grid(True)
pyplot.savefig(filename + '.png')
Related posts
- How to draw a simple line using python and the matplotlib API - — posted 2007-01-05
- How to use the pylab API vs. the matplotlib API — posted 2007-01-04
- How to create some derived arrow classes with matplotlib and python — posted 2007-01-03
- How to draw an arrow with matplotlib and python — posted 2007-01-02
- Example pie charts using python and matplotlib — posted 2006-12-19
Comments
what is the fucking results ?