def METHOD_NAME(self):
    """Toggle matplotlib interactive backend."""
    if self._current_id is None or self._gui == 'failed':
        return
    backend = "inline" if self._gui != "inline" else "auto"
    sw = self._shellwidget_dict[self._current_id]["widget"]
    sw.execute("%matplotlib " + backend)
    is_spyder_kernel = self._shellwidget_dict[self._current_id][
        "widget"].is_spyder_kernel
    if not is_spyder_kernel:
        self.update_matplotlib_gui(backend)