analistica/ex-6/plot.py
Giù Marcer 76d5f3bebd ex-6: wrote something about ex-6 in the readme file and put in order ex.6/plots
ex-6/plots/emd-round.py renamed into ex-6/plots/emd.py and made interactive.
2020-07-05 11:35:56 +02:00

18 lines
414 B
Python
Executable File

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