class_docstr: !
  @brief Visualizer for cluster in multi-dimensional data.
  @details Multi-dimensional cluster visualizer is useful data whose dimension is greater than three, but it
            is able to visualize data with any dimensions. The multidimensional visualizer helps to overcome
            'cluster_visualizer' shortcoming - an ability to display clusters in 1D, 2D or 3D dimensional data
            space only.
  
      Example of clustering results visualization where `Iris` is used:
      @code
          from pyclustering.utils import read_sample
          from pyclustering.samples.definitions import FAMOUS_SAMPLES
          from pyclustering.cluster import cluster_visualizer_multidim
          from pyclustering.cluster.center_initializer import kmeans_plusplus_initializer
          from pyclustering.cluster.xmeans import xmeans
  
          # load 4D data sample 'Iris'
          sample_4d = read_sample(FAMOUS_SAMPLES.SAMPLE_IRIS)
  
          # initialize 3 initial centers using K-Means++ algorithm
          centers = kmeans_plusplus_initializer(sample_4d, 3).initialize()
  
          # performs cluster analysis using X-Means
          xmeans_instance = xmeans(sample_4d, centers)
          xmeans_instance.process()
          clusters = xmeans_instance.get_clusters()
  
          # visualize obtained clusters in multi-dimensional space
          visualizer = cluster_visualizer_multidim()
          visualizer.append_clusters(clusters, sample_4d)
          visualizer.show(max_row_size=3)
      @endcode
  
      Visualized clustering results of `Iris` data (multi-dimensional data):
      @image html xmeans_clustering_famous_iris.png "Fig. 1. X-Means clustering results (data 'Iris')."
  
      Sometimes no need to display results in all dimensions. Parameter `filter` can be used to display only
      interesting coordinate pairs. Here is an example of visualization of pair coordinates (x0, x1) and (x0, x2) for
      previous clustering results:
      @code
          visualizer = cluster_visualizer_multidim()
          visualizer.append_clusters(clusters, sample_4d)
          visualizer.show(pair_filter=[[0, 1], [0, 2]])
      @endcode
  
      Visualized results of specified coordinate pairs:
      @image html xmeans_clustering_famous_iris_filtered.png "Fig. 2. X-Means clustering results (x0, x1) and (x0, x2) (data 'Iris')."
  
      The multi-dimensional visualizer can be used to display clusters in 1-, 2- and 3-dimensional data similar to
      `cluster_visualizer`. `cluster_visualizer_multidim` uses three plots to display 3-dimensional data:
      `(x0, x1)`, `(x0, x2)` and `(x1, x2)`. There is an example:
      @code
          from pyclustering.utils import read_sample
          from pyclustering.samples.definitions import FCPS_SAMPLES
          from pyclustering.cluster import cluster_visualizer_multidim
          from pyclustering.cluster.gmeans import gmeans
  
          # load 3-dimensional data sample 'Hepta'
          sample_3d = read_sample(FCPS_SAMPLES.SAMPLE_HEPTA)
  
          # performs cluster analysis using G-Means algorithm
          gmeans_instance = gmeans(sample_3d).process().get_clusters()
  
          # visualize obtained clusters in 3-dimensional space (x0, x1), (x0, x2), (x1, x2):
          visualizer = cluster_visualizer_multidim()
          visualizer.append_clusters(clusters, sample_3d)
          visualizer.show(max_row_size=3)
      @endcode
  
      Visualized clustering results of `Hepta` data (3-dimensional data):
      @image html gmeans_hepta_multidim_visualizer.png "Fig. 3. G-Means clustering results (3-dimensional data 'Hepta')."
  
      Example with 2-dimensional data `Lsun`:
      @code
          # load 2-dimensional data sample 'Lsun'
          sample_2d = read_sample(FCPS_SAMPLES.SAMPLE_LSUN)
          clusters = gmeans(sample_2d).process().get_clusters()
  
          # visualize obtained clusters in 2-dimensional space (x0, x1):
          visualizer = cluster_visualizer_multidim()
          visualizer.append_clusters(clusters, sample_2d)
          visualizer.show()
      @endcode
  
      Visualized clustering results of `Lsun` (2-dimensional data):
      @image html gmeans_lsun_multidim_visualizer.png "Fig. 4. G-Means clustering results (2-dimensional data 'Lsun')."
docstr: !
  @brief Create grid specification for figure to place canvases.
  
  @param[in] amount_axis (uint): Amount of canvases that should be organized by the created grid specification.
  @param[in] max_row_size (max_row_size): Maximum number of canvases on one row.
  
  @return (gridspec.GridSpec) Grid specification to place canvases on figure.
docstr_tok: ["!","@","brief","Create","grid","specification","for","figure","to","place","canvases",".","@","param","[","in","]","amount_axis","(","uint",")",":","Amount","of","canvases","that","should","be","organized","by","the","created","grid","specification",".","@","param","[","in","]","max_row_size","(","max_row_size",")",":","Maximum","number","of","canvases","on","one","row",".","@","return","(","gridspec.GridSpec",")","Grid","specification","to","place","canvases","on","figure","."]
code: def __create_grid_spec(self, amount_axis, max_row_size):
      """!
      @brief Create grid specification for figure to place canvases.
  
      @param[in] amount_axis (uint): Amount of canvases that should be organized by the created grid specification.
      @param[in] max_row_size (max_row_size): Maximum number of canvases on one row.
  
      @return (gridspec.GridSpec) Grid specification to place canvases on figure.
  
      """
      row_size = amount_axis
      if row_size > max_row_size:
          row_size = max_row_size
  
      col_size = math.ceil(amount_axis / row_size)
      return gridspec.GridSpec(col_size, row_size)
  
imports: import itertools
  import math
  import matplotlib.pyplot
  import matplotlib.gridspec
  from mpl_toolkits.mplot3d import Axes3D
  from pyclustering.utils.color import color
label_desc: Use image node_id 7 for calling the cluster_visualizer_multidim obj's underlying member method code with example usage: obj.__create_grid_spec(amount_axis, max_row_size) and returns: gridspec