fix for station scatter error

This commit is contained in:
Marcel Paffrath 2017-05-03 12:00:34 +02:00
parent 413a921e5d
commit efe47d7a20
2 changed files with 9 additions and 3 deletions

View File

@ -1 +1 @@
fce0c-dirty 413a-dirty

View File

@ -271,8 +271,14 @@ class map_projection(QtGui.QWidget):
if hasattr(self, 'cid'): if hasattr(self, 'cid'):
self.canvas.mpl_disconnect(self.cid) self.canvas.mpl_disconnect(self.cid)
del(self.cid) del(self.cid)
self.sc.remove() try:
self.legend.remove() 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() self.canvas.draw()
def remove_contourf(self): def remove_contourf(self):