code: def freqdist(
      features,
      X,
      y=None,
      ax=None,
      n=50,
      orient="h",
      color=None,
      show=True,
      **kwargs,
  ):
      """Displays frequency distribution plot for text.
  
      This helper function is a quick wrapper to utilize the FreqDist
      Visualizer (Transformer) for one-off analysis.
  
      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.
  
      X: ndarray or DataFrame of shape n x m
          A matrix of n instances with m features. In the case of text,
          X is a list of list of already preprocessed words
  
      y: ndarray or Series of length n
          An array or series of target or class values
  
      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
  
      show: bool, default: True
          If True, calls ``show()``, which in turn calls ``plt.show()`` however
          you cannot call ``plt.savefig`` from this signature, nor
          ``clear_figure``. If False, simply calls ``finalize()``
  
      kwargs: dict
          Keyword arguments passed to the super class.
  
      Returns
      -------
      visualizer: FreqDistVisualizer
          Returns the fitted, finalized visualizer
      """
      # Instantiate the visualizer
      viz = FreqDistVisualizer(
          features, ax=ax, n=n, orient=orient, color=color, **kwargs
      )
  
      # Fit and transform the visualizer (calls draw)
      viz.fit(X, y, **kwargs)
      viz.transform(X)
  
      # Draw the final visualization
      if show:
          viz.show()
      else:
          viz.finalize()
  
      # Return the visualizer object
      return viz
  
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 1 for calling a global function with example usage: freqdist(features, X, y, ax, n, orient, color, show) and returns: viz