pingouin.plot_paired(data=None, dv=None, within=None, subject=None, order=None, boxplot=True, figsize=(4, 4), dpi=100, ax=None, colors=['green', 'grey', 'indianred'], pointplot_kwargs={'markers': '.', 'scale': 0.6}, boxplot_kwargs={'color': 'lightslategrey', 'width': 0.2})[source]

Paired plot.

datapandas DataFrame

Long-format dataFrame.


Name of column containing the dependant variable.


Name of column containing the within-subject factor. Note that within must have exactly two within-subject levels (= two unique values).


Name of column containing the subject identifier.

orderlist of str

List of values in within that define the order of elements on the x-axis of the plot. If None, uses alphabetical order.


If True, add a boxplot to the paired lines using the seaborn.boxplot() function.


Figsize in inches


Resolution of the figure in dots per inches.

axmatplotlib axes

Axis on which to draw the plot.

colorslist of str

Line colors names. Default is green when value increases from A to B, indianred when value decreases from A to B and grey when the value is the same in both measurements.


Dictionnary of optional arguments that are passed to the seaborn.pointplot() function.


Dictionnary of optional arguments that are passed to the seaborn.boxplot() function.

axMatplotlib Axes instance

Returns the Axes object with the plot for further tweaking.


Data must be a long-format pandas DataFrame.


Default paired plot:

>>> from pingouin import read_dataset
>>> df = read_dataset('mixed_anova')
>>> df = df.query("Group == 'Meditation' and Subject > 40")
>>> df = df.query("Time == 'August' or Time == 'June'")
>>> import pingouin as pg
>>> ax = pg.plot_paired(data=df, dv='Scores', within='Time',
...                     subject='Subject', dpi=150)

Paired plot on an existing axis (no boxplot and uniform color):

>>> from pingouin import read_dataset
>>> df = read_dataset('mixed_anova').query("Time != 'January'")
>>> import pingouin as pg
>>> import matplotlib.pyplot as plt
>>> fig, ax1 = plt.subplots(1, 1, figsize=(5, 4))
>>> pg.plot_paired(data=df[df['Group'] == 'Meditation'],
...                dv='Scores', within='Time', subject='Subject',
...                ax=ax1, boxplot=False,
...                colors=['grey', 'grey', 'grey'])  # doctest: +SKIP