report_slide

report_slide(doc, title=None, content=None, layout=None, master=None, **kwargs)

Add a whole slide in one call (title plus its content).

The one-line-per-slide wrapper: starts a new slide, sets its title, and places content on it, so a deck script reads as one line per slide. content is dispatched by type: a chart becomes an image, a data frame a table, text a bulleted text box. Equivalent to report_add_slide() followed by the matching report_add_*() call.

Parameters

Name Type Description Default
doc pptx.Presentation or docx.Document A document from report_new(). required
title str Slide title, typically the survey question the slide answers. None
content plotnine.ggplot, pandas.DataFrame, str or list of str What the slide shows. None (default) adds an empty titled slide. None
layout str Passed to report_add_slide(); None auto-selects. None
master str Passed to report_add_slide(); None auto-selects. None
**kwargs Passed on to report_add_plot(), report_add_table() or report_add_text() depending on content. {}

Returns

Name Type Description
pptx.Presentation or docx.Document The document.

See Also

report_section, report_title_slide, report_add_slide

Examples

>>> chart = plot_bars(calc_percentage(podracing_survey, "demo_gender"))
>>> doc = report_slide(report_new("pptx"), "Who follows pod racing?", chart)