code: def plot_brain_schematics(ax, direction, **kwargs):
      """Create matplotlib patches from a json custom format and plot them \
      on a matplotlib Axes.
  
      Parameters
      ----------
      ax : A MPL axes instance
          The axes in which the plots will be drawn.
  
      direction : {'x', 'y', 'z', 'l', 'r'}
          The directions of the view.
  
      **kwargs :
          Passed to the matplotlib patches constructor.
  
      Returns
      -------
      object_bounds : (xmin, xmax, ymin, ymax) tuple
          Useful for the caller to be able to set axes limits.
  
      """
      get_axis_bg_color = ax.get_facecolor()
  
      black_bg = colors.colorConverter.to_rgba(
          get_axis_bg_color
      ) == colors.colorConverter.to_rgba("k")
  
      json_filename, transform = _get_json_and_transform(direction)
      with open(json_filename) as json_file:
          json_content = json.loads(json_file.read())
  
      mpl_patches = _get_mpl_patches(
          json_content,
          transform=transform + ax.transData,
          invert_color=black_bg,
          **kwargs,
      )
  
      for mpl_patch in mpl_patches:
          ax.add_patch(mpl_patch)
  
      object_bounds = _get_object_bounds(json_content, transform)
  
      return object_bounds
  
file_path: nilearn/nilearn/plotting/glass_brain.py
imports: import json
  import os
  from matplotlib import colors, patches, transforms
  from matplotlib.path import Path
label_desc: Use image node_id 8 for calling a global function with example usage: plot_brain_schematics(ax, direction) and returns: object_bounds