From ca9cc8c94e652ba37b0fa34dbf2f94307bd801a6 Mon Sep 17 00:00:00 2001 From: Will McElhenney Date: Tue, 14 May 2024 13:11:36 -0500 Subject: [PATCH 1/2] Fix '--' text issue in `heatmap` I'm not sure why this text is getting added to the ax but this is a simple fix that seems to work on my machine. In my case with my data (not the collisions dataset), the '--' text only occurred once in the ax. I'm not sure if that's the case for all data, but I leave it up to the maintainers to determine whether or not that is a valid fix for most cases. --- missingno/missingno.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/missingno/missingno.py b/missingno/missingno.py index 7de259d..a7f3bfd 100644 --- a/missingno/missingno.py +++ b/missingno/missingno.py @@ -393,9 +393,13 @@ def heatmap( ax0.xaxis.set_ticks_position('none') ax0.yaxis.set_ticks_position('none') ax0.patch.set_visible(False) - + for text in ax0.texts: - t = float(text.get_text()) + if text.get_text() != '--': + t = float(text.get_text()) + else: + continue + if 0.95 <= t < 1: text.set_text('<1') elif -1 < t <= -0.95: From 307944389e53a47439cf5f22cbce0620c5aea66b Mon Sep 17 00:00:00 2001 From: Will McElhenney Date: Tue, 14 May 2024 13:13:12 -0500 Subject: [PATCH 2/2] Remove whitespace --- missingno/missingno.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/missingno/missingno.py b/missingno/missingno.py index a7f3bfd..581e6a4 100644 --- a/missingno/missingno.py +++ b/missingno/missingno.py @@ -393,7 +393,7 @@ def heatmap( ax0.xaxis.set_ticks_position('none') ax0.yaxis.set_ticks_position('none') ax0.patch.set_visible(False) - + for text in ax0.texts: if text.get_text() != '--': t = float(text.get_text())