watex.view.QuickPlot.multicatdist#

QuickPlot.multicatdist(*, x=None, col=None, hue=None, targets=None, x_features=None, y_features=None, kind='count', **kws)[source]#

Figure-level interface for drawing multiple categorical distributions plots onto a FacetGrid.

Multiple categorials plots from targetted pd.series.

Parameters
  • x (list , Optional,) – names of variables in data. Inputs for plotting long-form data. See examples for interpretation. Here it can correspond to x_features , y_features and targets from dataframe. Note that each columns item could be correspond as element of x, y or hue. For instance x_features could refer to x-axis features and must be more than 0 and set into a list. the y_features might match the columns name for sns.catplot. If number of feature is more than one, create a list to hold all features is recommended. the y should fit the sns.catplot argument hue. Like other it should be on list of features are greater than one.

  • y (list , Optional,) – names of variables in data. Inputs for plotting long-form data. See examples for interpretation. Here it can correspond to x_features , y_features and targets from dataframe. Note that each columns item could be correspond as element of x, y or hue. For instance x_features could refer to x-axis features and must be more than 0 and set into a list. the y_features might match the columns name for sns.catplot. If number of feature is more than one, create a list to hold all features is recommended. the y should fit the sns.catplot argument hue. Like other it should be on list of features are greater than one.

  • hue (list , Optional,) – names of variables in data. Inputs for plotting long-form data. See examples for interpretation. Here it can correspond to x_features , y_features and targets from dataframe. Note that each columns item could be correspond as element of x, y or hue. For instance x_features could refer to x-axis features and must be more than 0 and set into a list. the y_features might match the columns name for sns.catplot. If number of feature is more than one, create a list to hold all features is recommended. the y should fit the sns.catplot argument hue. Like other it should be on list of features are greater than one.

  • row – Categorical variables that will determine the faceting of the grid.

  • data (str or pd.core.DataFrame) – Categorical variables that will determine the faceting of the grid.

  • optional – Categorical variables that will determine the faceting of the grid.

  • col_wrapint – “Wrap” the column variable at this width, so that the column facets span multiple rows. Incompatible with a row facet.

  • estimator (string or callable that maps vector -> scalar, optional) – Statistical function to estimate within each categorical bin.

  • errorbar (string, (string, number) tuple, or callable) – Name of errorbar method (either “ci”, “pi”, “se”, or “sd”), or a tuple with a method name and a level parameter, or a function that maps from a vector to a (min, max) interval.

  • n_bootint – Number of bootstrap samples used to compute confidence intervals.

  • optional – Number of bootstrap samples used to compute confidence intervals.

  • units (name of variable in data or vector data, optional) – Identifier of sampling units, which will be used to perform a multilevel bootstrap and account for repeated measures design.

  • seed (int, numpy.random.Generator, or numpy.random.RandomState, optional) – Seed or random number generator for reproducible bootstrapping.

  • order (lists of strings, optional) – Order to plot the categorical levels in; otherwise the levels are inferred from the data objects.

  • hue_order (lists of strings, optional) – Order to plot the categorical levels in; otherwise the levels are inferred from the data objects.

  • row_order (lists of strings, optional) – Order to organize the rows and/or columns of the grid in, otherwise the orders are inferred from the data objects.

  • col_order (lists of strings, optional) – Order to organize the rows and/or columns of the grid in, otherwise the orders are inferred from the data objects.

  • height (scalar) – Height (in inches) of each facet. See also: aspect.

  • aspect (scalar) – Aspect ratio of each facet, so that aspect * height gives the width of each facet in inches.

  • kind (str, optional) – `The kind of plot to draw, corresponds to the name of a categorical axes-level plotting function. Options are: “strip”, “swarm”, “box”, “violin”, “boxen”, “point”, “bar”, or “count”.

  • native_scale (bool, optional) – When True, numeric or datetime values on the categorical axis will maintain their original scaling rather than being converted to fixed indices.

  • formatter (callable, optional) – Function for converting categorical data into strings. Affects both grouping and tick labels.

  • orient ("v" | "h", optional) – Orientation of the plot (vertical or horizontal). This is usually inferred based on the type of the input variables, but it can be used to resolve ambiguity when both x and y are numeric or when plotting wide-form data.

  • color (matplotlib color, optional) – Single color for the elements in the plot.

  • palette (palette name, list, or dict) – Colors to use for the different levels of the hue variable. Should be something that can be interpreted by color_palette(), or a dictionary mapping hue levels to matplotlib colors.

  • hue_norm (tuple or matplotlib.colors.Normalize object) – Normalization in data units for colormap applied to the hue variable when it is numeric. Not relevant if hue is categorical.

  • legend (str or bool, optional) – Set to False to disable the legend. With strip or swarm plots, this also accepts a string, as described in the axes-level docstrings.

  • legend_out (bool) – If True, the figure size will be extended, and the legend will be drawn outside the plot on the center right.

  • share{x (bool, 'col', or 'row' optional) – If true, the facets will share y axes across columns and/or x axes across rows.

  • y} (bool, 'col', or 'row' optional) – If true, the facets will share y axes across columns and/or x axes across rows.

  • margin_titles (bool) – If True, the titles for the row variable are drawn to the right of the last column. This option is experimental and may not work in all cases.

  • facet_kws (dict, optional) – Dictionary of other keyword arguments to pass to FacetGrid.

  • kwargs (key, value pairings) – Other keyword arguments are passed through to the underlying plotting function.

  • data – Path -like object or Dataframe. Long-form (tidy) dataset for plotting. Each column should correspond to a variable, and each row should correspond to an observation. If data is given as path-like object,`QuickPlot` reads and sanitizes data before plotting. Be aware in this case to provide the target name and possible the classes for data inspection. Both str or dataframe need to provide the name of target.

Returns

Returns self for easy method chaining.

Return type

QuickPlot instance

Notes

The argument for data must be passed to fit method. data parameter is not allowed in other QuickPlot method. The description of the parameter data is to give a synopsis of the kind of data the plot expected. An error will raise if force to pass data argument as a keyword arguments.

Examples

>>> from watex.view.plot import QuickPlot
>>> from watex.datasets import load_bagoue
>>> data = load_bagoue ().frame
>>> qplotObj= QuickPlot(lc='b', tname='flow')
>>> qplotObj.sns_style = 'darkgrid'
>>> qplotObj.mapflow=True # to categorize the flow rate
>>> qplotObj.fit(data)
>>> fdict={
...            'x':['shape', 'type', 'type'],
...            'col':['type', 'geol', 'shape'],
...            'hue':['flow', 'flow', 'geol'],
...            }
>>> qplotObj.multicatdist(**fdict)