code: def undobutton_action(self):
          
          if len(self.history) > 1:
              old = self.history.pop(-1)
              self.selection_array = old
              self.mask.set_data(old)
              self.fig.canvas.draw_idle()
docs: when undo is clicked, revert the thematic map to the previous state