code: def kmean_hypersphere():
      """Run K-means on the sphere."""
      n_samples = 50
      dim = 2
      n_clusters = 2
      manifold = Hypersphere(dim)
  
      # Generate data on north pole
      cluster_1 = manifold.random_von_mises_fisher(
          kappa=50, n_samples=n_samples
      )
  
      # Generate data on south pole
      cluster_2 = manifold.random_von_mises_fisher(
          kappa=50, n_samples=n_samples
      )
      cluster_2 = -cluster_2
  
      data = gs.concatenate((cluster_1, cluster_2), axis=0)
  
      kmeans = RiemannianKMeans(manifold, n_clusters, tol=1e-3)
      kmeans.fit(data)
      cluster_centers = kmeans.cluster_centers_
      labels = kmeans.labels_
  
      plt.figure(2)
      colors = ["red", "blue"]
  
      ax = visualization.plot(
          data, space="S2", marker=".", color="black"
      )
  
      for i in range(n_clusters):
          if len(data[labels == i]) > 0:
              ax = visualization.plot(
                  points=data[labels == i],
                  ax=ax,
                  space="S2",
                  marker=".",
                  color=colors[i],
              )
  
      ax = visualization.plot(
          cluster_centers,
          ax=ax,
          space="S2",
          marker="*",
          s=200,
          color="green",
      )
  
      ax.set_title("Kmeans on the sphere")
  
      return plt
  
file_path: geomstats/examples/plot_kmeans_manifolds.py
imports: import logging
  import os
  import matplotlib.pyplot
  import geomstats.backend
  import geomstats.visualization
  from geomstats.geometry.hypersphere import Hypersphere
  from geomstats.geometry.poincare_ball import PoincareBall
  from geomstats.learning.kmeans import RiemannianKMeans
label_desc: Use image node_id 2 for calling a global function with example usage: kmean_hypersphere() and returns: plt