class_docstr: Abstract class for confusion matrix
  
  You shouldn't instantiate this class.
  You might instantiate ConfusionMatrix or BinaryConfusionMatrix classes
class_docstr_tok: ["Abstract","class","for","confusion","matrix","You","should","n't","instantiate","this","class",".","You","might","instantiate","ConfusionMatrix","or","BinaryConfusionMatrix","classes"]
docstr: Plots confusion matrix
docstr_tok: ["Plots","confusion","matrix"]
code: def plot(
      self,
      normalized=False,
      backend="matplotlib",
      ax=None,
      max_colors=10,
      **kwargs,
  ):
      """
      Plots confusion matrix
      """
  
      df = self.to_dataframe(normalized)
  
      try:
          cmap = kwargs["cmap"]
      except KeyError:
          import matplotlib.pyplot as plt
  
          cmap = plt.cm.gray_r
  
      title = self.title
  
      if normalized:
          title += " (normalized)"
  
      if backend == "matplotlib":
          import matplotlib.pyplot as plt
  
          # if ax is None:
          fig, ax = plt.subplots(figsize=(9, 8))
          plt.imshow(
              df, cmap=cmap, interpolation="nearest"
          )  # imshow / matshow
          ax.set_title(title)
  
          tick_marks_col = np.arange(len(df.columns))
          tick_marks_idx = tick_marks_col.copy()
  
          ax.set_yticks(tick_marks_idx)
          ax.set_xticks(tick_marks_col)
          ax.set_xticklabels(df.columns, rotation=45, ha="right")
          ax.set_yticklabels(df.index)
  
          ax.set_ylabel(df.index.name)
          ax.set_xlabel(df.columns.name)
  
          # N_min = 0
          N_max = self.max()
          if N_max > max_colors:
              # Continuous colorbar
              plt.colorbar()
          else:
              # Discrete colorbar
              pass
              # ax2 = fig.add_axes([0.93, 0.1, 0.03, 0.8])
              # bounds = np.arange(N_min, N_max + 2, 1)
              # norm = mpl.colors.BoundaryNorm(bounds, cmap.N)
              # cb = mpl.colorbar.ColorbarBase(ax2, cmap=cmap, norm=norm, spacing='proportional', ticks=bounds, boundaries=bounds, format='%1i')
  
          return ax
  
      elif backend == "seaborn":
          import seaborn as sns
  
          ax = sns.heatmap(df, **kwargs)
          return ax
          # You should test this yourself
          # because I'm facing an issue with Seaborn under Mac OS X (2015-04-26)
          # RuntimeError: Cannot get window extent w/o renderer
          # sns.plt.show()
  
      else:
          msg = "'backend' must be either 'matplotlib' or 'seaborn'"
          raise ValueError(msg)
  
imports: import numpy
  import pandas
  import collections
  import pandas_ml
  from pandas_ml.confusion_matrix.stats import binom_interval, class_agreement, prop_test
label_desc: Use image node_id 18 for calling the ConfusionMatrixAbstract obj's underlying member method code with example usage: obj.plot(normalized, backend, ax, max_colors) and returns: ax, ax