docs: def sign_plot(x, g=None, flat=False, labels=True, cmap=None,
                cbar_ax_bbox=None, ax=None, **kwargs):
      """
      Significance plot, a heatmap of p values (based on Seaborn).
  
      Parameters
      ----------
      x : array_like, ndarray or DataFrame
          If flat is False (default), x must be an array, any object exposing
          the array interface, containing p values. If flat is True, x must be
          a sign_array (returned by `scikit_posthocs.sign_array` function)
  
      g : array_like or ndarray, optional
          An array, any object exposing the array interface, containing
          group names.
  
      flat : bool, optional
          If `flat` is True, plots a significance array as a heatmap using
          seaborn. If `flat` is False (default), plots an array of p values.
          Non-flat mode is useful if you need to  differentiate significance
          levels visually. It is the preferred mode.
  
      labels : bool, optional
          Plot axes labels (default) or not.
  
      cmap : list, optional
          1) If flat is False (default):
          List consisting of five elements, that will be exported to
          ListedColormap method of matplotlib. First is for diagonal
          elements, second is for non-significant elements, third is for
          p < 0.001, fourth is for p < 0.01, fifth is for p < 0.05.
  
          2) If flat is True:
          List consisting of three elements, that will be exported to
          ListedColormap method of matplotlib. First is for diagonal
          elements, second is for non-significant elements, third is for
          significant ones.
          3) If not defined, default colormaps will be used.
  
      cbar_ax_bbox : list, optional
          Colorbar axes position rect [left, bottom, width, height] where
          all quantities are in fractions of figure width and height.
          Refer to `matplotlib.figure.Figure.add_axes` for more information.
          Default is [0.95, 0.35, 0.04, 0.3].
  
      ax : matplotlib Axes, optional
          Axes in which to draw the plot, otherwise use the currently-active Axes.
  
      kwargs : other keyword arguments
          Keyword arguments to be passed to seaborn heatmap method. These
          keyword args cannot be used: cbar, vmin, vmax, center.
  
      Returns
      -------
      Axes object with the heatmap (and ColorBase object of cbar if `flat` is set to
      False).
  
      Examples
      --------
      >>> x = np.array([[-1,  1,  1],
                        [ 1, -1,  0],
                        [ 1,  0, -1]])
      >>> ph.sign_plot(x, flat = True)
  
      """
  
      try:
          del kwargs['cbar'], kwargs['vmin'], kwargs['vmax'], kwargs['center']
      except:
          pass
  
      if isinstance(x, DataFrame):
          df = x.copy()
      else:
          x = np.array(x)
          g = g or np.arange(x.shape[0])
          df = DataFrame(x, index=g, columns=g)
  
      dtype = df.values.dtype
  
      if not np.issubdtype(dtype, np.integer) and flat:
          raise ValueError("X should be a sign_array or DataFrame of integer values")
      elif not np.issubdtype(dtype, np.floating) and not flat:
          raise ValueError("X should be an array or DataFrame of float p values")
  
      if not cmap and flat:
          # format: diagonal, non-significant, significant
          cmap = ['1', '#fbd7d4', '#1a9641']
      elif not cmap and not flat:
          # format: diagonal, non-significant, p<0.001, p<0.01, p<0.05
          cmap = ['1', '#fbd7d4', '#005a32', '#238b45', '#a1d99b']
  
      if flat:
          g = heatmap(df, vmin=-1, vmax=1, cmap=ListedColormap(cmap), cbar=False, ax=ax,
                      **kwargs)
          if not labels:
              g.set_xlabel('')
              g.set_ylabel('')
          return g
  
      else:
          df[(x <= 0.001) & (x >= 0)] = 1
          df[(x <= 0.01) & (x > 0.001)] = 2
          df[(x <= 0.05) & (x > 0.01)] = 3
          df[(x > 0.05)] = 0
          np.fill_diagonal(df.values, -1)
  
          if len(cmap) != 5:
              raise ValueError("Cmap list must contain 5 items")
  
          g = heatmap(df, vmin=-1, vmax=3, cmap=ListedColormap(cmap), center=1, cbar=False,
                      ax=ax, **kwargs)
          if not labels:
              g.set_xlabel('')
              g.set_ylabel('')
  
          cbar_ax = g.figure.add_axes(cbar_ax_bbox or [0.95, 0.35, 0.04, 0.3])
          cbar = ColorbarBase(cbar_ax, cmap=ListedColormap(cmap[2:] + [cmap[1]]),
                              boundaries=[0, 1, 2, 3, 4])
          cbar.set_ticks(np.linspace(0.5, 3.5, 4))
          cbar.set_ticklabels(['p < 0.001', 'p < 0.01', 'p < 0.05', 'NS'])
  
          cbar.outline.set_linewidth(1)
          cbar.outline.set_edgecolor('0.5')
          cbar.ax.tick_params(size=0)
  
          return g, cbar