diff --git a/pysegcnn/core/graphics.py b/pysegcnn/core/graphics.py
index 0b76ac3754719a5a67da60d95b72c0363abc672b..4f696ae0a07982968c01a41e3938ebc00baed54f 100644
--- a/pysegcnn/core/graphics.py
+++ b/pysegcnn/core/graphics.py
@@ -243,7 +243,7 @@ def plot_sample(x, use_bands, labels,
     # check whether to apply constrast stretching
     rgb = np.dstack([np.clip(
         contrast_stretching(x[use_bands.index(band), ...], alpha), 0, 1)
-        for band in bands])
+        for band in bands]).astype(np.float32)
 
     # sort the labels in ascending order
     sorted_labels = {k: v for k, v in sorted(labels.items())}