better subplot

This commit is contained in:
Roman Zeyde
2014-07-05 13:46:54 +03:00
parent 25e895029d
commit 7f382d68d4

View File

@@ -92,11 +92,15 @@ def receive(x, freqs):
streams = []
ugly_hack = itertools.izip(*list(symbols))
i = 0
pylab.figure()
width = np.floor(np.sqrt(len(freqs)))
height = np.ceil(len(freqs) / float(width))
for freq, S in zip(freqs, ugly_hack):
i += 1
S = filters[freq](S)
S = np.array(list(S))
pylab.subplot(2,2,i)
pylab.subplot(height, width, i)
show.constellation(S, title='$F_c = {} Hz$'.format(freq))
bits = sigproc.modulator.decode(S) # list of bit tuples
streams.append(bits)