Loading...

vastorbit.VastColumn.density

VastColumn.density(by: str | None = None, nbins: int = 100, chart: PlottingBase | TableSample | Axes | mFigure | Figure | None = None, **style_kwargs) PlottingBase | TableSample | Axes | mFigure | Figure

Draws the VastColumn Density Plot using histogram approximation.

Parameters:
  • by (str, optional) – VastColumn used to partition the data.

  • nbins (int, optional) – Number of bins for histogram approximation. Higher values give smoother density estimates.

  • 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 Density

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),
    }
)

Now we are ready to draw the plot:

data["score1"].density()

See also

VastFrame.density() : Density Plot.
VastFrame.range_plot() : Range Plot.
VastColumn.hist() : Histogram.