I am wondering whether there is a bug in the statsmodels module function qqplot_2samples(). The documentation (https://www.statsmodels.org/stable/generated/statsmodels.graphics.gofplots.qqplot_2samples.html) says that the first parameter is the x data and the second parameter is y data. Then you can define xlabel and ylabel to give a name to each axis.
I tried with my data and I think the axis titles are inverted.
import statsmodels.api as sm
import numpy as np
import matplotlib.pyplot as plt
x_data = np.arange(10)
y_data = np.arange(10,20)
x = sm.ProbPlot(x_data)
y = sm.ProbPlot(y_data)
sm.qqplot_2samples(x,y, xlabel="x", ylabel="y")
plt.show()
Unless I'm missing something on what this functions does, the y-axis is the one going to 20, not the x.
This has been fixed in master and will be out in the 0.14 release. Running your code now produces:
You can install the master version one of two ways:
pip install git+https://github.com/statsmodels/statsmodels.git
pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple statsmodels
. These are official nightly wheels.