class_docstr: A frequency distribution tells us the frequency of each vocabulary
  item in the text. In general, it could count any kind of observable
  event. It is a distribution because it tells us how the total
  number of word tokens in the text are distributed across the
  vocabulary items.
  
  
  Parameters
  ----------
  features : list, default: None
      The list of feature names from the vectorizer, ordered by index. E.g.
      a lexicon that specifies the unique vocabulary of the corpus. This
      can be typically fetched using the ``get_feature_names()`` method of
      the transformer in Scikit-Learn.
  
  ax : matplotlib axes, default: None
      The axes to plot the figure on.
  
  n: integer, default: 50
      Top N tokens to be plotted.
  
  orient : 'h' or 'v', default: 'h'
      Specifies a horizontal or vertical bar chart.
  
  color : string
      Specify color for bars
  
  kwargs : dict
      Pass any additional keyword arguments to the super class.
  
  These parameters can be influenced later on in the visualization
  process, but can and should be set as early as possible.
class_docstr_tok: ["A","frequency","distribution","tells","us","the","frequency","of","each","vocabulary","item","in","the","text",".","In","general",",","it","could","count","any","kind","of","observable","event",".","It","is","a","distribution","because","it","tells","us","how","the","total","number","of","word","tokens","in","the","text","are","distributed","across","the","vocabulary","items",".","Parameters","--","--","--","--","--","features",":","list",",","default",":","None","The","list","of","feature","names","from","the","vectorizer",",","ordered","by","index",".","E.g",".","a","lexicon","that","specifies","the","unique","vocabulary","of","the","corpus",".","This","can","be","typically","fetched","using","the","``","get_feature_names","(",")","``","method","of","the","transformer","in","Scikit-Learn",".","ax",":","matplotlib","axes",",","default",":","None","The","axes","to","plot","the","figure","on",".","n",":","integer",",","default",":","50","Top","N","tokens","to","be","plotted",".","orient",":","'","h","'","or","'","v","'",",","default",":","'","h'","Specifies","a","horizontal","or","vertical","bar","chart",".","color",":","string","Specify","color","for","bars","kwargs",":","dict","Pass","any","additional","keyword","arguments","to","the","super","class",".","These","parameters","can","be","influenced","later","on","in","the","visualization","process",",","but","can","and","should","be","set","as","early","as","possible","."]
docstr: Called from the fit method, this method creates the canvas and
  draws the distribution plot on it.
  
  Parameters
  ----------
  kwargs: generic keyword arguments.
docstr_tok: ["Called","from","the","fit","method",",","this","method","creates","the","canvas","and","draws","the","distribution","plot","on","it",".","Parameters","--","--","--","--","--","kwargs",":","generic","keyword","arguments","."]
code: def draw(self, **kwargs):
      """
      Called from the fit method, this method creates the canvas and
      draws the distribution plot on it.
  
      Parameters
      ----------
      kwargs: generic keyword arguments.
  
      """
      # Prepare the data
      bins = np.arange(self.N)
      words = [self.features[i] for i in self.sorted_[: self.N]]
      freqs = {}
  
      # Set up the bar plots
      if self.conditional_freqdist_:
          for label, values in sorted(
              self.conditional_freqdist_.items(), key=itemgetter(0)
          ):
              freqs[label] = [values[i] for i in self.sorted_[: self.N]]
      else:
          freqs["corpus"] = [
              self.freqdist_[i] for i in self.sorted_[: self.N]
          ]
  
      # Draw a horizontal barplot
      if self.orient == "h":
          # Add the barchart, stacking if necessary
          for label, freq in freqs.items():
              self.ax.barh(
                  bins,
                  freq,
                  label=label,
                  color=self.color,
                  align="center",
              )
  
          # Set the y ticks to the words
          self.ax.set_yticks(bins)
          self.ax.set_yticklabels(words)
  
          # Order the features from top to bottom on the y axis
          self.ax.invert_yaxis()
  
          # Turn off y grid lines and turn on x grid lines
          self.ax.yaxis.grid(False)
          self.ax.xaxis.grid(True)
  
      # Draw a vertical barplot
      elif self.orient == "v":
          # Add the barchart, stacking if necessary
          for label, freq in freqs.items():
              self.ax.bar(
                  bins,
                  freq,
                  label=label,
                  color=self.color,
                  align="edge",
              )
  
          # Set the y ticks to the words
          self.ax.set_xticks(bins)
          self.ax.set_xticklabels(words, rotation=90)
  
          # Turn off x grid lines and turn on y grid lines
          self.ax.yaxis.grid(True)
          self.ax.xaxis.grid(False)
  
      # Unknown state
      else:
          raise YellowbrickValueError("Orientation must be 'h' or 'v'")
  
      return self.ax
  
file_path: yellowbrick/yellowbrick/text/freqdist.py
imports: import numpy
  from operator import itemgetter
  from yellowbrick.text.base import TextVisualizer
  from yellowbrick.exceptions import YellowbrickValueError
label_desc: Use image node_id 4 for calling the FrequencyVisualizer obj's underlying member method code with example usage: obj.draw() and returns: self