plot_dividends
function backtide.analysis.dividends.plot_dividends(data, title=None, legend="upper left", figsize=(900, 600), filename=None, display=True)[source]
Create a dividend history chart.
Displays dividend payments over time for one or more symbols as a bar chart with markers, making it easy to compare payout history and identify trends.
| Parameters |
data : pd.DataFrame | pl.DataFrame
Input data containing columns
title : str | dict | None, default=Nonesymbol, ex_date (unix timestamp
or datetime) and amount with the dividend amount.
Title for the plot.
legend : str | dict | None, default="upper left"
Legend for the plot. See the user guide for an extended
description of the choices.
figsize : tuple[int, int], default=(900, 600)
Figure's size in pixels, format as (x, y).
filename : str | Path | None, default=None
Save the plot using this name. The type of the file depends on the
provided name (
display : bool | None, default=True.html, .png, .pdf, etc...). If filename has no
file type, the plot is saved as .html. If None, the plot isn't saved.
Whether to render the plot. If
None, it returns the figure.
|
| Returns |
Figure | None
The Plotly figure object. Only returned if
display=None.
|
See Also
Create a drawdown chart.
Create a price line chart.
Create a returns distribution histogram.
Example
>>> from backtide.storage import query_dividends
>>> from backtide.analysis import plot_dividends
>>> df = query_dividends("MSFT")
>>> plot_dividends(df)