Only plot noise if noise_samples > 0

This commit is contained in:
Mattéo Delabre 2019-12-16 01:49:35 -05:00
parent 2b93a5f1bc
commit 4d8d419d31
Signed by: matteo
GPG Key ID: AE3FBD02DC583ABB
1 changed files with 12 additions and 11 deletions

View File

@ -140,15 +140,16 @@ def plot_constellation(
)
# Plot channel noise
noisy_vectors = channel(constellation.repeat(noise_samples, 1))
if noise_samples > 0:
noisy_vectors = channel(constellation.repeat(noise_samples, 1))
ax.scatter(
*zip(*noisy_vectors.tolist()),
marker='.',
s=5,
c=list(range(order)) * noise_samples,
cmap=color_map,
norm=color_norm,
alpha=0.7,
zorder=8
)
ax.scatter(
*zip(*noisy_vectors.tolist()),
marker='.',
s=5,
c=list(range(order)) * noise_samples,
cmap=color_map,
norm=color_norm,
alpha=0.3,
zorder=8
)