egttools.plotting.barplots.stacked_barplot

stacked_barplot(x, y, hue, data, ylabel=None, xlabel=None, figsize=(15, 8), colors=['#b2df8a', '#1f78b4', '#a6cee3'], bbox_to_anchor=(0.62, 0.4), adjust={'right': 0.9})[source]

Plots stacked bar plots where with x values in the x axis and y values in the y axis and colored by hue. The plots are organized by col and plotted in a grid of columns = min(nb_cols, unique(cols)). :type x: str :param x: (str) name of the column of the pandas.Dataframe to be used as x asis :type y: str :param y: (str) name of the column of the pandas.Dataframe to use as y axis :type hue: str :param hue: (str) name of the column of the pandas.Dataframe to be used to color the stacked bar plot :type data: DataFrame :param data: (pandas.DataFrame) dataframe containing the data to be plotted :type ylabel: Optional[str] :param ylabel: (str) label for the y axis :type xlabel: Optional[str] :param xlabel: (str) label for the x axis :type figsize: Tuple[int, int] :param figsize: tuple containing the size of the figure :type colors: List[str] :param colors: list containing the colors used in the plot :type bbox_to_anchor: Tuple[float, float] :param bbox_to_anchor: positioning of the legend in the figure :type adjust: Dict[str, float] :param adjust: dictionary containing the parameters to position the subplots in the figure :return Dictionary(figure, axes, legend)

Return type:

Dict[str, TypeVar(T, figure, axes, Legend)]