code: def adjust_positions(self, redraw=True):
          
          checks = [self.view_positions, self.subaxes, self.subplots]
          right = all('right' in check for check in checks)
          top = all('top' in check for check in checks)
          if not 'main' in self.subplots or not (top or right):
              return
          if redraw:
              self.handles['fig'].canvas.draw()
          main_ax = self.subplots['main'].handles['axis']
          bbox = main_ax.get_position()
          if right:
              ax = self.subaxes['right']
              subplot = self.subplots['right']
              if isinstance(subplot, AdjoinedPlot):
                  subplot_size = subplot.subplot_size
                  border_size = subplot.border_size
              else:
                  subplot_size = 0.25
                  border_size = 0.25
              ax.set_position([bbox.x1 + bbox.width * border_size,
                               bbox.y0,
                               bbox.width * subplot_size, bbox.height])
              if isinstance(subplot, GridPlot):
                  ax.set_aspect('equal')
          if top:
              ax = self.subaxes['top']
              subplot = self.subplots['top']
              if isinstance(subplot, AdjoinedPlot):
                  subplot_size = subplot.subplot_size
                  border_size = subplot.border_size
              else:
                  subplot_size = 0.25
                  border_size = 0.25
              ax.set_position([bbox.x0,
                               bbox.y1 + bbox.height * border_size,
                               bbox.width, bbox.height * subplot_size])
              if isinstance(subplot, GridPlot):
                  ax.set_aspect('equal')
docs: Make adjustments to the positions of subplots (if available)
          relative to the main plot axes as required.
  
          This method is called by LayoutPlot after an initial pass
          used to position all the Layouts together. This method allows
          LayoutPlots to make final adjustments to the axis positions.