class_docstr: Word correlation illustrates the extent to which words in a corpus appear in the
  same documents.
  
  WordCorrelationPlot visualizes the binary correlation between words across
  documents as a heatmap. The correlation is defined using the mean square
  contingency coefficient (phi-coefficient) between any two words m and n. The
  coefficient is a value between -1 and 1, inclusive. A value close to 1 or -1
  indicates strong positive or negative correlation between m and n, while a value
  close to 0 indicates little or no correlation. The constructor takes one required
  argument, which is the list of words or n-grams to be plotted.
  
  Parameters
  ----------
  words : list of str
      The list of words or n-grams to be plotted. The words must be present in the
      provided corpus on fit().
  
  ignore_case : bool, default: False
      If True, all words will be converted to lowercase before processing.
  
  ax : matplotlib Axes, default: None
      The axes to plot the figure on.
  
  cmap : str or cmap, default: "RdYlBu"
      Colormap to use for the heatmap.
  
  colorbar : bool, default: True
      If True, a colorbar will be added to the heatmap.
  
  fontsize : int, default: None
      Font size to use for the labels on the axes.
  
  kwargs : dict
      Pass any additional keyword arguments to the super class.
  
  Attributes
  ----------
  self.doc_term_matrix_ : array of shape (n_docs, n_features)
      The computed sparse document-term matrix containing binary values indicating if
      a word is present in a document.
  
  self.num_docs_ : int
      The number of observed documents in the corpus.
  
  self.vocab_ : dict
      A dictionary mapping words to their indices in the document-term matrix.
  
  self.num_features_ : int
      The number of features (word labels) in the resulting plot.
  
  self.correlation_matrix_ : ndarray of shape (n_features, n_features)
      The computed matrix containing the phi-coefficients between all features.
docstr: Called from the fit() method, this metod draws the heatmap on the figure using
  the computed correlation matrix.
docstr_tok: ["Called","from","the","fit","(",")","method",",","this","metod","draws","the","heatmap","on","the","figure","using","the","computed","correlation","matrix","."]
code: def draw(self, X):
      """
      Called from the fit() method, this metod draws the heatmap on the figure using
      the computed correlation matrix.
      """
  
      # Use correlation matrix data for the heatmap
      wc_display = self.correlation_matrix_
  
      # Set up the dimensions of the pcolormesh
      X, Y = np.arange(self.num_features_ + 1), np.arange(
          self.num_features_ + 1
      )
      self.ax.set_ylim(bottom=0, top=wc_display.shape[0])
      self.ax.set_xlim(left=0, right=wc_display.shape[1])
  
      # Set the words as the tick labels on the plot. The Y-axis is sorted from top
      # to bottom, the X-axis is sorted from left to right.
      xticklabels = self.words
      yticklabels = self.words[::-1]
      ticks = np.arange(self.num_features_) + 0.5
      self.ax.set(xticks=ticks, yticks=ticks)
      self.ax.set_xticklabels(
          xticklabels, rotation="vertical", fontsize=self.fontsize
      )
      self.ax.set_yticklabels(yticklabels, fontsize=self.fontsize)
  
      # Flip the Y-axis values so that they match the sorted labels
      wc_display = np.flipud(wc_display)
  
      # Draw the labels in each heatmap cell
      for x in X[:-1]:
          for y in Y[:-1]:
              # Get the correlation value for the cell
              value = wc_display[x, y]
              svalue = "{:.2f}".format(value)
  
              # Get a compatible text color for the cell
              base_color = self.cmap(value / 2 + 0.5)
              text_color = find_text_color(base_color)
  
              # Draw the text at the center of the cell
              # Note: x and y coordinates are swapped to match the pcolormesh
              cx, cy = y + 0.5, x + 0.5
              self.ax.text(
                  cx,
                  cy,
                  svalue,
                  va="center",
                  ha="center",
                  color=text_color,
                  fontsize=self.fontsize,
              )
  
      # Draw the heatmap
      g = self.ax.pcolormesh(
          X, Y, wc_display, cmap=self.cmap, vmin=-1, vmax=1
      )
  
      # Add the color bar
      if self.colorbar:
          self.ax.figure.colorbar(g, ax=self.ax)
  
      return self.ax
  
file_path: yellowbrick/yellowbrick/text/correlation.py
imports: import numpy
  from sklearn.feature_extraction.text import CountVectorizer
  from yellowbrick.style import find_text_color
  from yellowbrick.text.base import TextVisualizer
  from yellowbrick.style.palettes import color_sequence
  from yellowbrick.exceptions import YellowbrickValueError
label_desc: Use image node_id 6 for calling the WordCorrelationPlot obj's underlying member method code with example usage: obj.draw(X) and returns: self