code: def _compute_ax_scalings(bn, xlim, ylim):
      """Compute scale factors for a unified plot."""
      if isinstance(ylim[0], (tuple, list, np.ndarray)):
          ylim = (ylim[0][0], ylim[1][0])
      pos = bn.pos
      bn.x_s = pos[2] / (xlim[1] - xlim[0])
      bn.x_t = pos[0] - bn.x_s * xlim[0]
      bn.y_s = pos[3] / (ylim[1] - ylim[0])
      bn.y_t = pos[1] - bn.y_s * ylim[0]
  
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 6 for calling a global function with example usage: _compute_ax_scalings(bn, xlim, ylim) without return types