HistogramChart

class qf_lib.plotting.charts.histogram_chart.HistogramChart(series: collections.abc.Sequence, best_fit: bool = False, bins: Union[int, str] = 20, start_x: Any = None, end_x: Any = None, **plot_settings)[source]

Bases: qf_lib.plotting.charts.chart.Chart

Constructs a new histogram based on the series specified.

Parameters
  • series (Sequence) – The series to plot in the histogram.

  • best_fit (boolean, default False.) – Whether a best fit line should be drawn.

  • bins (int, str) – The amount of intervals to use for this histogram.

  • start_x (Any) – The upper bound of the x-axis.

  • end_x (Any) – The lower bound of the x-axis.

  • plot_settings – Options to pass to the hist function.

Methods

plot(figsize, float] = None)

Plots the chart.

plot(figsize: Tuple[float, float] = None)[source]

Plots the chart. The underlying figure stays hidden until the show() method is called.

Parameters

figsize (Tuple[float, float]) – The figure size to draw the chart at in inches. This is a tuple of (width, height) passed directly to matplotlib’s plot function. The values are expressed in inches.