code: def set_margins(self, left=0.1, top=0.1, right=0.1, bottom=0.1,
                      delay_draw=False):
          "set margins"
          self.margins = (left, top, right, bottom)
          if self.panel is not None:
              self.panel.gridspec.update(left=left, top=1-top,
                                         right=1-right, bottom=bottom)
          for ax in self.canvas.figure.get_axes():
              ax.update_params()
              ax.set_position(ax.figbox)
          if not delay_draw:
              self.canvas.draw()
          if callable(self.margin_callback):
              self.margin_callback(left=left, top=top, right=right, bottom=bottomf set_margins(self, left=0.1, top=0.1, right=0.1, bottom=0.1,
                      delay_draw=False):
          "set margins"
          self.margins = (left, top, right, bottom)
          if self.panel is not None:
              self.panel.gridspec.update(left=left, top=1-top,
                                         right=1-right, bottom=bottom)
          for ax in self.canvas.figure.get_axes():
              ax.update_params()
              ax.set_position(ax.figbox)
          if not delay_draw:
              self.canvas.draw()
          if callable(self.margin_callback):
              self.margin_callback(left=left, top=top, right=right, bottom=bottom)
docs: set margins