analistica/ex-6/plot.py

19 lines
413 B
Python
Executable File

#!/usr/bin/env python
from pylab import *
import sys
figure()
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.)')
xlabel('$\\theta$')
ylabel('$I(\\theta)$')
tight_layout()
show()