moderndid.plots.plot_gt#

moderndid.plots.plot_gt(result: MPResult | DDDMultiPeriodResult | DDDMultiPeriodRCResult, show_ci: bool = True, ref_line: float | None = 0, title: str = 'Group', xlab: str | None = None, ylab: str | None = None, ncol: int = 1, **_kwargs: Any) ggplot[source]#

Plot group-time average treatment effects.

Parameters:
resultMPResult, DDDMultiPeriodResult, or DDDMultiPeriodRCResult

Multi-period result object containing group-time ATT estimates. This should be the output from att_gt() or ddd().

show_cibool, default=True

Whether to show confidence intervals as error bars.

ref_linefloat or None, default=0

Y-value for reference line. Set to None to hide.

titlestr, default=”Group”

Title prefix for each facet panel.

xlabstr, optional

X-axis label. Defaults to “Time”.

ylabstr, optional

Y-axis label. Defaults to “ATT”.

ncolint, default=1

Number of columns in the facet grid. Use 1 for vertical stacking.

Returns:
plotnine.ggplot

A plotnine ggplot object that can be further customized.