analistica/ex-6/plot.py

18 lines
414 B
Python
Raw Normal View History

2020-03-06 02:24:32 +01:00
#!/usr/bin/env python
from pylab import *
import sys
plt.figure(figsize=(5, 3))
rcParams['font.size'] = 8
2020-03-06 02:24:32 +01:00
a, b, f = loadtxt(sys.stdin, unpack=True)
title(sys.argv[1] if len(sys.argv) > 1 else "", loc='right')
2020-05-01 00:43:50 +02:00
hist(a, np.insert(b, 0, a[0]), weights=100*f/sum(f),
histtype='stepfilled', color='#e3c5ca', edgecolor='#92182b')
2020-03-17 23:32:04 +01:00
xlabel(r'$\theta$ (radians)')
ylabel(r'$I(\theta)$ (a.u.)')
2020-05-01 00:43:50 +02:00
tight_layout()
show()