class_docstr: Test plotting.py.
class_docstr_tok: ["Test","plotting.py","."]
docstr: Test plot_paired()
docstr_tok: ["Test","plot_paired","(",")"]
code: def test_plot_paired(self):
      """Test plot_paired()"""
      df = read_dataset("mixed_anova")
      df = df.query(
          "Group == 'Meditation' and Subject > 40 and "
          "(Time == 'August' or Time == 'June')"
      ).copy()
      df.loc[[101, 161], "Scores"] = 6
      ax = plot_paired(
          data=df, dv="Scores", within="Time", subject="Subject"
      )
      assert isinstance(ax, matplotlib.axes.Axes)
      _, (ax1, ax2) = plt.subplots(1, 2, figsize=(9, 4))
      plot_paired(
          data=df,
          dv="Scores",
          within="Time",
          subject="Subject",
          boxplot=False,
          ax=ax1,
      )
      plot_paired(
          data=df,
          dv="Scores",
          within="Time",
          subject="Subject",
          order=["June", "August"],
          ax=ax2,
      )
      plot_paired(
          data=df,
          dv="Scores",
          within="Time",
          subject="Subject",
          order=["June", "August"],
          boxplot_in_front=True,
          ax=ax2,
      )
      # Test with more than two within levels
      df = read_dataset("mixed_anova")
      df = df.query("Group == 'Meditation' and Subject > 40").copy()
      df.loc[[101, 161], "Scores"] = 6
      plot_paired(
          data=df,
          dv="Scores",
          within="Time",
          subject="Subject",
          order=["January", "June", "August"],
      )
      plot_paired(
          data=df,
          dv="Scores",
          within="Time",
          subject="Subject",
          order=["January", "June", "August"],
          orient="h",
      )
      plot_paired(
          data=df,
          dv="Scores",
          within="Time",
          subject="Subject",
          orient="h",
          boxplot=False,
      )
      plt.close("all")
  
file_path: pingouin/pingouin/tests/test_plotting.py
imports: import pytest
  import matplotlib
  import numpy
  from scipy import stats
  import seaborn
  import matplotlib.pyplot
  from unittest import TestCase
  from pingouin import read_dataset
  from pingouin.plotting import plot_blandaltman, _ppoints, qqplot, plot_paired, plot_shift, plot_rm_corr, plot_circmean
label_desc: Use image node_id 4 for calling the TestPlotting obj's underlying member method code with example usage: obj.test_plot_paired() without return types