import numpy as np
import statsmodels.api as sm
import pylab
test = np.random.normal(20, 5, 1000)
sm.qqplot(test, line='q')
pylab.show()
sm.qqplot(aaa, line = "45", fit = True)
line='45'
参数时,会出现以下绘图结果。
我们可以看到,发生的情况是,在statsmodels绘制的Q-Q图中,理论分位数没有重新调整为原始伪样本的尺寸,这就是为什么蓝线被限制在您的图的左侧边缘的原因。你可以尝试将fit参数设置为True