class_docstr: Rasterized Rectangles specified using center points
  
  {usage}
  
  Parameters
  ----------
  {common_parameters}
  
  hjust : float, default=0.5
      Horizontal justification for the rectangle at point `x`.
      Default is 0.5, which centers the rectangle horizontally.
      Must be in the range `[0, 1]`.
  vjust : float, default=0.5
      Vertical justification for the rectangle at point `y`
      Default is 0.5, which centers the rectangle vertically.
      Must be in the range `[0, 1]`.
  interpolation : str, default=None
      How to calculate values between the center points of
      adjacent rectangles. The default is `None`{.py} not to
      interpolate. Allowed values are:
      ```python
      "antialiased"
      "nearest"
      "bilinear"
      "bicubic"
      "spline16"
      "spline36"
      "hanning"
      "hamming"
      "hermite"
      "kaiser"
      "quadric"
      "catrom"
      "gaussian"
      "bessel"
      "mitchell"
      "sinc"
      "lanczos"
      "blackman"
      ```
  filterrad : float, default=4.0
      The filter radius for filters that have a radius parameter, i.e.
      when interpolation is one of: `sinc`, `lanczos`, `blackman`.
      Must be a number greater than zero.
  
  See Also
  --------
  plotnine.geoms.geom_rect
  plotnine.geoms.geom_tile
class_docstr_tok: ["Rasterized","Rectangles","specified","using","center","points","{","usage","}","Parameters","--","--","--","--","--","{","common_parameters","}","hjust",":","float",",","default=0.5","Horizontal","justification","for","the","rectangle","at","point","`","x","`",".","Default","is","0.5",",","which","centers","the","rectangle","horizontally",".","Must","be","in","the","range","`","[","0",",","1","]","`",".","vjust",":","float",",","default=0.5","Vertical","justification","for","the","rectangle","at","point","`","y","`","Default","is","0.5",",","which","centers","the","rectangle","vertically",".","Must","be","in","the","range","`","[","0",",","1","]","`",".","interpolation",":","str",",","default=None","How","to","calculate","values","between","the","center","points","of","adjacent","rectangles",".","The","default","is","`","None","`","{",".py","}","not","to","interpolate",".","Allowed","values","are",":","``","`","python","``","antialiased","''","``","nearest","''","``","bilinear","''","``","bicubic","''","``","spline16","''","``","spline36","''","``","hanning","''","``","hamming","''","``","hermite","''","``","kaiser","''","``","quadric","''","``","catrom","''","``","gaussian","''","``","bessel","''","``","mitchell","''","``","sinc","''","``","lanczos","''","``","blackman","''","``","`","filterrad",":","float",",","default=4.0","The","filter","radius","for","filters","that","have","a","radius","parameter",",","i.e",".","when","interpolation","is","one","of",":","`","sinc","`",",","`","lanczos","`",",","`","blackman","`",".","Must","be","a","number","greater","than","zero",".","See","Also","--","--","--","--","plotnine.geoms.geom_rect","plotnine.geoms.geom_tile"]
docstr: Plot all groups
docstr_tok: ["Plot","all","groups"]
code: def draw_panel(
      self,
      data: pd.DataFrame,
      panel_params: panel_view,
      coord: Coord,
      ax: Axes,
      **params: Any,
  ):
      """
      Plot all groups
      """
      from matplotlib.colors import to_rgba_array
      from matplotlib.image import AxesImage
  
      if not isinstance(coord, coord_cartesian):
          raise PlotnineError(
              "geom_raster only works with cartesian coordinates"
          )
  
      data = coord.transform(data, panel_params)
      x = data["x"].to_numpy().astype(float)
      y = data["y"].to_numpy().astype(float)
      facecolor = to_rgba_array(data["fill"].to_numpy())
      facecolor[:, 3] = data["alpha"].to_numpy()
  
      # Convert vector of data to flat image,
      # figure out dimensions of raster on plot, and the colored
      # indices.
      x_pos = ((x - x.min()) / resolution(x, False)).astype(int)
      y_pos = ((y - y.min()) / resolution(y, False)).astype(int)
      nrow = y_pos.max() + 1
      ncol = x_pos.max() + 1
      yidx, xidx = nrow - y_pos - 1, x_pos
  
      # Create and "color" the matrix.
      # Any gaps left whites (ones) colors pluse zero alpha values
      # allows makes it possible to have a "neutral" interpolation
      # into the gaps when intervals are uneven.
      X = np.ones((nrow, ncol, 4))
      X[:, :, 3] = 0
      X[yidx, xidx] = facecolor
  
      im = AxesImage(
          ax,
          data=X,
          interpolation=params["interpolation"],
          origin="upper",
          extent=(
              data["xmin"].min(),
              data["xmax"].max(),
              data["ymin"].min(),
              data["ymax"].max(),
          ),
          rasterized=params["raster"],
          filterrad=params["filterrad"],
          zorder=params["zorder"],
      )
      ax.add_image(im)
  
file_path: plotnine/plotnine/geoms/geom_raster.py
imports: from __future__ import annotations
  import typing
  from warnings import warn
  import numpy
  from .._utils import resolution
  from ..coords import coord_cartesian
  from ..doctools import document
  from ..exceptions import PlotnineError, PlotnineWarning
  from .geom import geom
  from .geom_polygon import geom_polygon
label_desc: Use image node_id 3 for calling the geom_raster obj's underlying member method code with example usage: obj.draw_panel(data, panel_params, coord, ax) without return types