code: def _legend_axis(pos):
      """Add a legend axis to the bottom right."""
      import matplotlib.pyplot as plt
  
      left, bottom = pos[:, 0].max(), pos[:, 1].min()
      # check if legend axis overlaps a data axis
      overlaps = False
      for _pos in pos:
          h_overlap = _pos[0] <= left <= (_pos[0] + _pos[2])
          v_overlap = _pos[1] <= bottom <= (_pos[1] + _pos[3])
          if h_overlap and v_overlap:
              overlaps = True
              break
      if overlaps:
          left += 1.2 * _pos[2]
      wid, hei = pos[-1, 2:]
      return plt.axes([left, bottom, wid, hei])
  
imports: from copy import deepcopy
  from functools import partial
  import numpy
  from scipy import ndimage
  from .._fiff.pick import channel_type, pick_types
  from ..defaults import _handle_default
  from ..utils import Bunch, _check_option, _clean_names, _is_numeric, _to_rgb, fill_doc
  from .utils import DraggableColorbar, _check_cov, _check_delayed_ssp, _draw_proj_checkbox, _plot_masked_image, _setup_ax_spines, _setup_vmin_vmax, add_background_image, plt_show
label_desc: Use image node_id 2 for calling a global function with example usage: _legend_axis(pos) and returns: plt