qis.plot_returns_heatmap¶
- qis.plot_returns_heatmap(prices, heatmap_freq='YE', heatmap_column_freq='ME', date_format='%Y', is_inverse_order=False, is_add_annual_column=True, cmap='RdYlGn', alpha=1.0, ytd_name='YTD', fontsize=5, vline_columns=None, hline_rows=None, figsize=None, ax=None, max_years=None, is_ytd_color_scale_independent=False, **kwargs)[source]¶
Plot periodic returns as a colour-coded calendar table.
Styling arguments shared by exported plot functions are documented in
qis/docs/plotting_kwargs.md.- Parameters:
prices (Series) – price or NAV series used to compute periodic returns.
heatmap_freq (str) – frequency defining table rows.
heatmap_column_freq (str | None) – frequency defining periodic-return columns.
date_format (str) – row-label date format.
is_inverse_order (bool) – whether to show the latest row first.
is_add_annual_column (bool) – whether to append the annual return column.
ytd_name (str) – label for the annual return column.
max_years (int | None) – maximum number of calendar rows to show; None keeps all rows.
is_ytd_color_scale_independent (bool) – whether periodic cells and the annual column use separate symmetric colour ranges while retaining the original annotations.
**kwargs – forwarded to
plot_heatmap.cmap (str | ListedColormap)
alpha (float)
fontsize (int)
ax (Axes)
- Returns:
The created figure, or None when drawing on a supplied axis.
- Raises:
ValueError – If
max_yearsis not positive or None.- Return type: