From e2f6d0e188bf35e3735e0f08643a5ca075356ee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20Gosselin?= Date: Wed, 31 Mar 2021 14:50:02 -0400 Subject: [PATCH] Hydrograph: don't add missing data marker to legend if none --- gwhat/hydrograph4.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gwhat/hydrograph4.py b/gwhat/hydrograph4.py index 07c0580f..d1c9ce53 100644 --- a/gwhat/hydrograph4.py +++ b/gwhat/hydrograph4.py @@ -539,8 +539,9 @@ def setup_legend(self): lg_labels.append(labelDB[2]) # Missing Data Markers - lg_handles.append(self.lmiss_ax4) - lg_labels.append(labelDB[3]) + if len(self.lmiss_ax4.get_xdata()): + lg_handles.append(self.lmiss_ax4) + lg_labels.append(labelDB[3]) # Continuous Line Datalogger lg_handles.append(self.l1_ax2)