code: def generate_fig_univariate(
      df_all: pd.DataFrame,
      col: str,
      hue: str,
      type: VarType,
      colors_dict: Optional[dict] = None,
  ) -> plt.Figure:
      """
      Returns a matplotlib figure containing the distribution of any kind of feature
      (continuous, categorical).
  
      If the feature is categorical and contains too many categories, the smallest
      categories are grouped into a new 'Other' category so that the graph remains
      readable.
  
      The input dataframe should contain the column of interest and a column that is used
      to distinguish two types of values (ex. 'train' and 'test')
  
      Parameters
      ----------
      df_all : pd.DataFrame
          The input dataframe that contains the column of interest
      col : str
          The column of interest
      hue : str
          The column used to distinguish the values (ex. 'train' and 'test')
      type: str
          The type of the series ('continous' or 'categorical')
      colors_dict : dict
          dict of colors used
  
      Returns
      -------
      matplotlib.pyplot.Figure
      """
      if type == VarType.TYPE_NUM:
          fig = generate_fig_univariate_continuous(
              df_all, col, hue=hue, colors_dict=colors_dict
          )
      elif type == VarType.TYPE_CAT:
          fig = generate_fig_univariate_categorical(
              df_all, col, hue=hue, colors_dict=colors_dict
          )
      else:
          raise NotImplementedError("Series dtype not supported")
      return fig
  
file_path: shapash/shapash/report/plots.py
imports: from typing import Union, Optional
  import pandas
  import numpy
  import seaborn
  import matplotlib.pyplot
  from matplotlib.colors import LinearSegmentedColormap
  from shapash.utils.utils import truncate_str
  from shapash.report.common import VarType
  from shapash.style.style_utils import get_pyplot_color, get_palette
label_desc: Use image node_id 1 for calling a global function with example usage: generate_fig_univariate(df_all, col, hue, type, colors_dict) and returns: fig