docs: def plot_colormap_components(cmap):
      """Plot the components of a given colormap."""
      from ._helpers import set_ax_labels  # recursive import protection
  
      plt.figure(figsize=[8, 4])
      gs = grd.GridSpec(3, 1, height_ratios=[1, 10, 1], hspace=0.05)
      # colorbar
      ax = plt.subplot(gs[0])
      gradient = np.linspace(0, 1, 256)
      gradient = np.vstack((gradient, gradient))
      ax.imshow(gradient, aspect="auto", cmap=cmap, vmin=0., vmax=1.)
      ax.set_title(cmap.name, fontsize=20)
      ax.set_axis_off()
      # components
      ax = plt.subplot(gs[1])
      x = np.arange(cmap.N)
      colors = cmap(x)
      r = colors[:, 0]
      g = colors[:, 1]
      b = colors[:, 2]
      RGB_weight = [0.299, 0.587, 0.114]
      k = np.sqrt(np.dot(colors[:, :3] ** 2, RGB_weight))
      r.clip(0, 1, out=r)
      g.clip(0, 1, out=g)
      b.clip(0, 1, out=b)
      xi = np.linspace(0, 1, x.size)
      plt.plot(xi, r, "r", linewidth=5, alpha=0.6)
      plt.plot(xi, g, "g", linewidth=5, alpha=0.6)
      plt.plot(xi, b, "b", linewidth=5, alpha=0.6)
      plt.plot(xi, k, "k", linewidth=5, alpha=0.6)
      ax.set_xlim(0, 1)
      ax.set_ylim(-0.1, 1.1)
      set_ax_labels(ax=ax, xlabel=None, xticks=False, ylabel="intensity")
      # grayified colorbar
      cmap = grayify_cmap(cmap)
      ax = plt.subplot(gs[2])
      gradient = np.linspace(0, 1, 256)
      gradient = np.vstack((gradient, gradient))
      ax.imshow(gradient, aspect="auto", cmap=cmap, vmin=0., vmax=1.)
      ax.set_axis_off()