class_docstr: RasterGridPlot evenly spaces out plots of individual projections on
  a grid, even when they differ in size. Since this class uses a single
  axis to generate all the individual plots it is much faster than the
  equivalent using subplots.
class_docstr_tok: ["RasterGridPlot","evenly","spaces","out","plots","of","individual","projections","on","a","grid",",","even","when","they","differ","in","size",".","Since","this","class","uses","a","single","axis","to","generate","all","the","individual","plots","it","is","much","faster","than","the","equivalent","using","subplots","."]
code: def initialize_plot(self, ranges=None):
      _, _, b_w, b_h, widths, heights = self.border_extents
  
      key = self.keys[-1]
      ranges = self.compute_ranges(self.layout, key, ranges)
      self.handles["projs"] = {}
      x, y = b_w, b_h
      for xidx, xkey in enumerate(self._xkeys):
          w = widths[xidx]
          for yidx, ykey in enumerate(self._ykeys):
              h = heights[yidx]
              if self.layout.ndims > 1:
                  vmap = self.layout.get((xkey, ykey), None)
              else:
                  vmap = self.layout.get(xkey, None)
              pane = vmap.select(
                  **{
                      d.name: val
                      for d, val in zip(self.dimensions, key)
                      if d in vmap.kdims
                  }
              )
              pane = (
                  vmap.last.values()[-1]
                  if issubclass(vmap.type, CompositeOverlay)
                  else vmap.last
              )
              data = get_raster_array(pane) if pane else None
              ranges = self.compute_ranges(vmap, key, ranges)
              opts = self.lookup_options(pane, "style")[
                  self.cyclic_index
              ]
              plot = self.handles["axis"].imshow(
                  data, extent=(x, x + w, y, y + h), **opts
              )
              cdim = pane.vdims[0].name
              valrange = match_spec(pane, ranges).get(
                  cdim, pane.range(cdim)
              )["combined"]
              plot.set_clim(valrange)
              if data is None:
                  plot.set_visible(False)
              self.handles["projs"][(xkey, ykey)] = plot
              y += h + b_h
              if xidx == 0:
                  self._yticks.append(y - b_h - h / 2.0)
          y = b_h
          x += w + b_w
          self._xticks.append(x - b_w - w / 2.0)
  
      kwargs = self._get_axis_kwargs()
      return self._finalize_axis(key, ranges=ranges, **kwargs)
  
imports: import sys
  import numpy
  import param
  from packaging.version import Version
  from ...core import CompositeOverlay, Element, traversal
  from ...core.util import isfinite, match_spec, max_range, unique_iterator
  from ...element.raster import RGB, Image, Raster
  from ..util import categorical_legend
  from .chart import PointPlot
  from .element import ColorbarPlot, ElementPlot, LegendPlot, OverlayPlot
  from .plot import GridPlot, MPLPlot, mpl_rc_context
  from .util import get_raster_array, mpl_version
label_desc: Use image node_id 5 for calling the RasterGridPlot obj's underlying member method code with example usage: obj.initialize_plot(ranges) and returns: self