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

Bases: Chart

Constructs a new histogram based on the series specified.

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



Plots the chart.

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

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


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.