From efe47d7a20836453c2613f214a119b6d12009458 Mon Sep 17 00:00:00 2001 From: Marcel Paffrath Date: Wed, 3 May 2017 12:00:34 +0200 Subject: [PATCH] fix for station scatter error --- pylot/RELEASE-VERSION | 2 +- pylot/core/util/map_projection.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pylot/RELEASE-VERSION b/pylot/RELEASE-VERSION index 84ed74ce..51306f6d 100644 --- a/pylot/RELEASE-VERSION +++ b/pylot/RELEASE-VERSION @@ -1 +1 @@ -fce0c-dirty +413a-dirty diff --git a/pylot/core/util/map_projection.py b/pylot/core/util/map_projection.py index 53fc8ac7..afa646b5 100644 --- a/pylot/core/util/map_projection.py +++ b/pylot/core/util/map_projection.py @@ -271,8 +271,14 @@ class map_projection(QtGui.QWidget): if hasattr(self, 'cid'): self.canvas.mpl_disconnect(self.cid) del(self.cid) - self.sc.remove() - self.legend.remove() + try: + self.sc.remove() + except Exception as e: + print('Warning: could not remove station scatter plot.\nReason: {}'.format(e)) + try: + self.legend.remove() + except Exception as e: + print('Warning: could not remove legend. Reason: {}'.format(e)) self.canvas.draw() def remove_contourf(self):