LoginSignup
2
2

More than 1 year has passed since last update.

回帰直線をPythonで引きたいならどうする?

Posted at

はじめに

問題

  • 回帰直線をPythonで引きたいならどうする?
    • notebookを使用している

方針・解法

matplotlibとseabornを使おう!

解答例

import seaborn as sns
%matplotlib inline 

width = 12
height = 10
plt.figure(figsize=(width, height)) # 縦と横の大きさを決める

# 実際に線を引く
sns.regplot(x="hogehoge", y="hogehoge", data=あなたが分析したいデータ)
plt.ylim(0,) # Xの下限を0に設定する

参考文献

Estimating regression fits -seaborn-
【初心者向け】seaborn入門 | Pythonを使ってデータを綺麗に可視化してみよう!

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2