[英]How can I specify the color of the line='s' or line=45 line drawn in a qq plot using statsmodels
I could not find any answer which could change the color from sm.qqplot
directly.我找不到任何可以直接从
sm.qqplot
更改颜色的答案。 So I tried by storing the plot in a subplot and then changing the color of the line from there.因此,我尝试将 plot 存储在子图中,然后从那里更改线条的颜色。
fig, ax = plt.subplots(1, figsize=(7,4.5))
sm.qqplot(data, line ='45',dist='norm',color='g',fmt='.g', ax=ax)
ax.grid()
ax.set_title('data_qq',fontsize=15)
ax.xaxis.get_label().set_fontsize(12)
ax.yaxis.get_label().set_fontsize(12)
ax.get_lines()[1].set_color("black")
ax.get_lines()[1].set_linewidth("2")
sm.qqplot
command.sm.qqplot
命令中执行此操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.