code: def highlight_canvas(self, highlight):
          
          colorname = self.canvas.palette().highlight().color().name()
          if highlight:
              self.canvas.setStyleSheet(
                      "FigureCanvas{border: 1px solid %s;}" % colorname)
          else:
              self.canvas.setStyleSheet("FigureCanvas{}")
docs: Set a colored frame around the FigureCanvas if highlight is True.