docstr: Display the grid in a figure
docstr_tok: ["Display","the","grid","in","a","figure"]
code: def display_grid(
      self, background_image, gridding, image_set_number, axes
  ):
      """Display the grid in a figure"""
      import matplotlib
  
      axes.cla()
      assert isinstance(axes, matplotlib.axes.Axes)
      assert isinstance(gridding, Grid)
      #
      # draw the image on the figure
      #
      if background_image is None:
          background_image = self.get_background_image(None, gridding)
      axes.imshow(background_image)
      #
      # Draw lines
      #
      for xc, yc in (
          (gridding.horiz_lines_x, gridding.horiz_lines_y),
          (gridding.vert_lines_x, gridding.vert_lines_y),
      ):
          for i in range(xc.shape[1]):
              line = matplotlib.lines.Line2D(
                  xc[:, i], yc[:, i], color="red"
              )
              axes.add_line(line)
      #
      # Draw labels in corners
      #
      for row in (0, gridding.rows - 1):
          for column in (0, gridding.columns - 1):
              label = str(gridding.spot_table[row, column])
              x = gridding.x_locations[column]
              y = gridding.y_locations[row]
              text = matplotlib.text.Text(
                  x,
                  y,
                  label,
                  horizontalalignment="center",
                  verticalalignment="center",
                  size="smaller",
                  color="black",
                  bbox=dict(
                      facecolor="white", alpha=0.5, edgecolor="black"
                  ),
              )
              axes.add_artist(text)
      axes.axis("image")
  
imports: import logging
  import centrosome.cpmorphology
  import numpy
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT
  from cellprofiler_core.constants.measurement import COLTYPE_INTEGER
  from cellprofiler_core.constants.measurement import IMAGE
  from cellprofiler_core.image import Image
  from cellprofiler_core.module import Module
  from cellprofiler_core.setting import Binary
  from cellprofiler_core.setting import Coordinates
  from cellprofiler_core.setting import ValidationError
  from cellprofiler_core.setting.choice import Choice
  from cellprofiler_core.setting.subscriber import ImageSubscriber
  from cellprofiler_core.setting.subscriber import LabelSubscriber
  from cellprofiler_core.setting.text import GridName
  from cellprofiler_core.setting.text import ImageName
  from cellprofiler_core.setting.text import Integer
  from cellprofiler_core.utilities.grid import Grid
label_desc: Use image node_id 15 for calling the DefineGrid obj's underlying member method code with example usage: obj.display_grid(background_image, gridding, image_set_number, axes) without return types