From 4d8d419d3121c73f0dbc1a5535e03681b4350cde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matt=C3=A9o=20Delabre?= Date: Mon, 16 Dec 2019 01:49:35 -0500 Subject: [PATCH] Only plot noise if noise_samples > 0 --- constellation/util.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/constellation/util.py b/constellation/util.py index 61e8497..fd2713b 100644 --- a/constellation/util.py +++ b/constellation/util.py @@ -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 + )