class_docstr: !
  @brief Common cluster visualizer for 1-, 2- and 3-dimensional data.
  @details `cluster_visualizer_multidim` visualizer can be used to display clusters in N-dimensional data.
  
  The general difference between `cluster_visualizer` and `cluster_visualizer_multidim` is a way of representation
  of 3-dimensional data. In case of `cluster_visualizer` 3-dimensional data is displayed in 3-dimensional plot with
  `x0`, `x1` and `x2` axis. In case of `cluster_visualizer_multidim` it displayed on three 2-dimensional plots:
  `(x0, x1)`, `(x0, x2)` and `(x1, x2)`.
  
  There is an example where sample `Atom` is used for clustering and displayed by `cluster_visualizer`:
  @code
      from pyclustering.utils import read_sample
      from pyclustering.samples.definitions import FCPS_SAMPLES
      from pyclustering.cluster import cluster_visualizer
      from pyclustering.cluster.dbscan import dbscan
  
      sample = read_sample(FCPS_SAMPLES.SAMPLE_ATOM)
      clusters = dbscan(sample, 15, 3).process().get_clusters()
  
      visualizer = cluster_visualizer()
      visualizer.append_clusters(clusters, sample)
      visualizer.show()
  @endcode
  
  Visualized clustering results of `Atom` data:
  @image html dbscan_atom_visualizer.png "Fig. 1. DBSCAN clustering results (3-dimensional data 'Atom')."
  
  @see cluster_visualizer_multidim
docstr: !
  @brief Shows clusters (visualize) on created or existed figure.
  @details The class is not responsible figures that used for visualization, they should be closed using
            `close()` method of this visualizer.
  
  @param[in] figure (fig): Defines requirement to use specified figure, if None - new figure is created for drawing clusters.
  @param[in] invisible_axis (bool): Defines visibility of axes on each canvas, if True - axes are invisible.
  @param[in] visible_grid (bool): Defines visibility of grid on each canvas, if True - grid is displayed.
  @param[in] display (bool): Defines requirement to display clusters on a stage, if True - clusters are displayed,
              if False - plt.show() should be called by user."
  @param[in] shift (uint): Force canvas shift value - defines canvas index from which custers should be visualized.
  
  @return (fig) Figure where clusters are shown.
docstr_tok: ["!","@","brief","Shows","clusters","(","visualize",")","on","created","or","existed","figure",".","@","details","The","class","is","not","responsible","figures","that","used","for","visualization",",","they","should","be","closed","using","`","close","(",")","`","method","of","this","visualizer",".","@","param","[","in","]","figure","(","fig",")",":","Defines","requirement","to","use","specified","figure",",","if","None","-","new","figure","is","created","for","drawing","clusters",".","@","param","[","in","]","invisible_axis","(","bool",")",":","Defines","visibility","of","axes","on","each","canvas",",","if","True","-","axes","are","invisible",".","@","param","[","in","]","visible_grid","(","bool",")",":","Defines","visibility","of","grid","on","each","canvas",",","if","True","-","grid","is","displayed",".","@","param","[","in","]","display","(","bool",")",":","Defines","requirement","to","display","clusters","on","a","stage",",","if","True","-","clusters","are","displayed",",","if","False","-","plt.show","(",")","should","be","called","by","user",".","''","@","param","[","in","]","shift","(","uint",")",":","Force","canvas","shift","value","-","defines","canvas","index","from","which","custers","should","be","visualized",".","@","return","(","fig",")","Figure","where","clusters","are","shown","."]
code: def show(
      self,
      figure=None,
      invisible_axis=True,
      visible_grid=True,
      display=True,
      shift=None,
  ):
      """!
      @brief Shows clusters (visualize) on created or existed figure.
      @details The class is not responsible figures that used for visualization, they should be closed using
                `close()` method of this visualizer.
  
      @param[in] figure (fig): Defines requirement to use specified figure, if None - new figure is created for drawing clusters.
      @param[in] invisible_axis (bool): Defines visibility of axes on each canvas, if True - axes are invisible.
      @param[in] visible_grid (bool): Defines visibility of grid on each canvas, if True - grid is displayed.
      @param[in] display (bool): Defines requirement to display clusters on a stage, if True - clusters are displayed,
                  if False - plt.show() should be called by user."
      @param[in] shift (uint): Force canvas shift value - defines canvas index from which custers should be visualized.
  
      @return (fig) Figure where clusters are shown.
  
      """
  
      canvas_shift = shift
      if canvas_shift is None:
          if figure is not None:
              canvas_shift = len(figure.get_axes())
          else:
              canvas_shift = 0
  
      if figure is not None:
          cluster_figure = figure
      else:
          cluster_figure = plt.figure()
  
      maximum_cols = self.__size_row
      maximum_rows = math.ceil(
          (self.__number_canvases + canvas_shift) / maximum_cols
      )
  
      grid_spec = gridspec.GridSpec(maximum_rows, maximum_cols)
  
      for index_canvas in range(len(self.__canvas_clusters)):
          canvas_data = self.__canvas_clusters[index_canvas]
          if len(canvas_data) == 0:
              continue
  
          dimension = self.__canvas_dimensions[index_canvas]
  
          # ax = axes[real_index];
          if (dimension == 1) or (dimension == 2):
              ax = cluster_figure.add_subplot(
                  grid_spec[index_canvas + canvas_shift]
              )
          else:
              ax = cluster_figure.add_subplot(
                  grid_spec[index_canvas + canvas_shift],
                  projection="3d",
              )
  
          if len(canvas_data) == 0:
              plt.setp(ax, visible=False)
  
          for cluster_descr in canvas_data:
              self.__draw_canvas_cluster(ax, dimension, cluster_descr)
  
              for attribute_descr in cluster_descr.attributes:
                  self.__draw_canvas_cluster(
                      ax, dimension, attribute_descr
                  )
  
          if invisible_axis is True:
              ax.xaxis.set_ticklabels([])
              ax.yaxis.set_ticklabels([])
  
              if dimension == 3:
                  ax.zaxis.set_ticklabels([])
  
          if self.__canvas_titles[index_canvas] is not None:
              ax.set_title(self.__canvas_titles[index_canvas])
  
          ax.grid(visible_grid)
  
      if display is True:
          plt.show()
  
      return cluster_figure
  
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 9 for calling the cluster_visualizer obj's underlying member method code with example usage: obj.show(figure, invisible_axis, visible_grid, display, shift) and returns: cluster_figure