Loading...

vastorbit.VastFrame.boxplot

VastFrame.boxplot(columns: Annotated[str | list[str], 'STRING representing one column or a list of columns'] | None = None, q: tuple[float, float] = (0.25, 0.75), max_nb_fliers: int = 30, whis: float = 1.5, chart: PlottingBase | TableSample | Axes | mFigure | Figure | None = None, **style_kwargs) PlottingBase | TableSample | Axes | mFigure | Figure

Draws the Box Plot of the input VastColumns.

Parameters:
  • columns (SQLColumns, optional) – List of the VastColumns names. If empty, all numerical VastColumns are used.

  • q (tuple, optional) – Tuple including the 2 quantiles used to draw the BoxPlot.

  • max_nb_fliers (int, optional) – Maximum number of points to use to represent the fliers of each category. Drawing fliers will slow down the graphic computation.

  • whis (float, optional) – The position of the whiskers.

  • chart (PlottingObject, optional) – The chart object to plot on.

  • **style_kwargs – Any optional parameter to pass to the plotting functions.

Returns:

Plotting Object.

Return type:

obj

Examples

Note

The below example is a very basic one. For other more detailed examples and customization options, please see Boxplot

Let’s begin by importing vastorbit.

import vastorbit as vo

Let’s also import numpy to create a dataset.

import numpy as np

We can create a variable N to fix the size:

N = 50

Let’s generate a dataset using the following data.

data = vo.VastFrame(
    {
        "score1": np.random.normal(5, 1, N),
        "score2": np.random.normal(8, 1.5, N),
        "score3": np.random.normal(10, 2, N),
    }
)

Below are examples of two types of boxplot:

  • Single (for one column)

  • Multi (for more than one column)

Check out the tabs below for specific examples.

data.boxplot(["score1"])
data.boxplot(columns = ["score1", "score2", "score3"])

See also

VastFrame.outliers_plot() : Outliers Plot.
VastColumn.boxplot() : Box Plot.