analistica/ex-6/dist-plot.py

32 lines
866 B
Python
Raw Permalink Normal View History

#!/usr/bin/env python
from pylab import *
import sys
n = int(input())
a, b, f = loadtxt(sys.stdin, unpack=True)
figure()
2020-05-18 00:32:32 +02:00
subplot(131)
title('FFT')
2020-05-19 16:37:05 +02:00
xlabel('EMD', x=0)
2020-05-13 01:15:30 +02:00
ylabel('counts')
hist(a[:n], insert(b[:n], 0, a[0]), weights=f[:n],
histtype='stepfilled', color='#e3c5ca', edgecolor='#92182b')
2020-05-18 00:32:32 +02:00
ticklabel_format(style='sci', axis='x', scilimits=(0, 0), useMathText=True)
2020-05-18 00:32:32 +02:00
subplot(132)
title('RL')
2020-05-18 00:32:32 +02:00
hist(a[n:2*n], insert(b[n:2*n], 0, a[n]), weights=f[n:2*n],
histtype='stepfilled', color='#e3c5ca', edgecolor='#92182b')
2020-05-18 00:32:32 +02:00
ticklabel_format(style='sci', axis='x', scilimits=(0, 0), useMathText=True)
subplot(133)
title('convolution')
hist(a[2*n:], insert(b[2*n:], 0, a[2*n]), weights=f[2*n:],
histtype='stepfilled', color='#e3c5ca', edgecolor='#92182b')
ticklabel_format(style='sci', axis='x', scilimits=(0, 0), useMathText=True)
tight_layout()
show()