Report.add_chart¶
add_chart ¶
add_chart(figure: object, *, title: str, caption: str | None = None, notes: str | None = None, id: str | None = None) -> ReportItem
Add a Matplotlib, plotnine, or Altair chart as static SVG.
Plotnine charts are converted to Matplotlib figures. Altair charts use Altair's SVG exporter, which optionally needs vl-convert-python. No JavaScript is included in the resulting HTML report.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Example¶
figure = ps.plots.histogram(df, 'age')
report.add_chart(figure, title='Age distribution')
Research note¶
Only aggregated plots should be shared when observations are sensitive.