class_docstr: The main purpose of these class is to have auto adjust of axes size
  to the data with different layout of cuts.
class_docstr_tok: ["The","main","purpose","of","these","class","is","to","have","auto","adjust","of","axes","size","to","the","data","with","different","layout","of","cuts","."]
code: def init_with_figure(
      cls,
      data=None,
      affine=None,
      threshold=None,
      cut_coords=None,
      figure=None,
      axes=None,
      black_bg=False,
      leave_space=False,
  ):
      cut_coords = cls.find_cut_coords(
          data, affine, threshold, cut_coords
      )
      if isinstance(axes, plt.Axes) and figure is None:
          figure = axes.figure
  
      if not isinstance(figure, plt.Figure):
          # Make sure that we have a figure
          figsize = cls._default_figsize[:]
          # Adjust for the number of axes
          figsize[0] *= len(cut_coords)
          facecolor = "k" if black_bg else "w"
  
          if leave_space:
              figsize[0] += 3.4
          figure = plt.figure(
              figure, figsize=figsize, facecolor=facecolor
          )
      else:
          if isinstance(axes, plt.Axes):
              assert axes.figure is figure, (
                  "The axes passed are not " "in the figure"
              )
  
      if axes is None:
          axes = [0.0, 0.0, 1.0, 1.0]
          if leave_space:
              axes = [0.3, 0, 0.7, 1.0]
      if is_iterable(axes):
          axes = figure.add_axes(axes)
      # People forget to turn their axis off, or to set the zorder, and
      # then they cannot see their slicer
      axes.axis("off")
      return cls(cut_coords, axes, black_bg)
  
imports: import matplotlib
  import matplotlib.pyplot
  import numpy
  from matplotlib import transforms
  from nipy.utils import is_iterable
  from ..datasets import VolumeImg
  from .None import cm
  from .coord_tools import coord_transform, find_cut_coords, get_bounds, get_mask_bounds
  from .edge_detect import _edge_map
label_desc: Use image node_id 3 for calling the BaseSlicer obj's underlying member method code with example usage: obj.init_with_figure(cls, data, affine, threshold, cut_coords, figure, axes, black_bg, leave_space) and returns: cls