code: def slice_in_3D(ax, i):
      # From https://stackoverflow.com/questions/44881885/python-draw-3d-cube
      Z = np.array(
          [
              [0, 0, 0],
              [1, 0, 0],
              [1, 1, 0],
              [0, 1, 0],
              [0, 0, 1],
              [1, 0, 1],
              [1, 1, 1],
              [0, 1, 1],
          ]
      )
  
      Z = Z * data.shape
      r = [-1, 1]
      X, Y = np.meshgrid(r, r)
  
      # Plot vertices
      ax.scatter3D(Z[:, 0], Z[:, 1], Z[:, 2])
  
      # List sides' polygons of figure
      verts = [
          [Z[0], Z[1], Z[2], Z[3]],
          [Z[4], Z[5], Z[6], Z[7]],
          [Z[0], Z[1], Z[5], Z[4]],
          [Z[2], Z[3], Z[7], Z[6]],
          [Z[1], Z[2], Z[6], Z[5]],
          [Z[4], Z[7], Z[3], Z[0]],
          [Z[2], Z[3], Z[7], Z[6]],
      ]
  
      # Plot sides
      ax.add_collection3d(
          Poly3DCollection(
              verts,
              facecolors=(0, 1, 1, 0.25),
              linewidths=1,
              edgecolors="darkblue",
          )
      )
  
      verts = np.array([[[0, 0, 0], [0, 0, 1], [0, 1, 1], [0, 1, 0]]])
      verts = verts * (60, 256, 256)
      verts += [i, 0, 0]
  
      ax.add_collection3d(
          Poly3DCollection(
              verts,
              facecolors="magenta",
              linewidths=1,
              edgecolors="black",
          )
      )
  
      ax.set_xlabel("plane")
      ax.set_xlim(0, 100)
      ax.set_ylabel("row")
      ax.set_zlabel("col")
  
      # Autoscale plot axes
      scaling = np.array(
          [getattr(ax, f"get_{dim}lim")() for dim in "xyz"]
      )
      ax.auto_scale_xyz(*[[np.min(scaling), np.max(scaling)]] * 3)
  
file_path: scikit-image/doc/examples/applications/plot_3d_image_processing.py
imports: import matplotlib.pyplot
  from mpl_toolkits.mplot3d.art3d import Poly3DCollection
  import numpy
  import plotly
  import plotly.express
  from skimage import exposure, util
  from skimage.data import cells3d
label_desc: Use image node_id 3 for calling a global function with example usage: slice_in_3D(ax, i) without return types