Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #cat file.txt | sed -e 's/,//g' -e 's/(//g' -e 's/)//g' > bar.txt
- f = open('bar.txt')
- adat = []
- for line in f.readlines():
- y = [value for value in line.split()]
- adat.append( y )
- f.close
- #print adat
- from pylab import * # Matplotlib
- def main():
- # sequence of data points to graph (x, y coordinates)
- points = adat
- graph(points)
- def graph(points):
- fig = figure(figsize=(100, 20)) # image dimensions
- ax = fig.add_subplot(111)
- ax.grid(True, color='#666666')
- xticks(size='x-small')
- yticks(size='x-small')
- x_seq = [item[0] for item in points]
- y_seq = [item[1] for item in points]
- ax.plot(x_seq, y_seq,
- color='blue', linestyle='-', linewidth=1.0, marker='o',
- markeredgecolor='blue', markerfacecolor='yellow', markersize=2.0)
- savefig('graph.png')
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment