code: def subplot_class_factory(axes_class=None):
      # This makes a new class that inherits from SubplotBase and the
      # given axes_class (which is assumed to be a subclass of Axes).
      # This is perhaps a little bit roundabout to make a new class on
      # the fly like this, but it means that a new Subplot class does
      # not have to be created for every type of Axes.
      if axes_class is None:
          axes_class = Axes
  
      new_class = _subplot_classes.get(axes_class)
      if new_class is None:
          new_class = type(
              str("%sSubplot") % (axes_class.__name__),
              (SubplotBase, axes_class),
              {"_axes_class": axes_class},
          )
          _subplot_classes[axes_class] = new_class
  
      return new_class
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import six
  from six.moves import map
  from matplotlib.gridspec import GridSpec, SubplotSpec
  from matplotlib import docstring
  import matplotlib.artist
  from matplotlib.axes._axes import Axes
  import matplotlib._layoutbox
  import warnings
  from matplotlib.cbook import mplDeprecation
label_desc: Use image node_id 1 for calling a global function with example usage: subplot_class_factory(axes_class) and returns: new_class