実現したいこと
seabornで複数のグラフを8行2列で描画したい。
前提
python:3.9.7
pandas:1.20.3
matplotlib:1.3.4
seaborn:0.11.2
発生している問題・エラーメッセージ
16種類のアウトプットが、8行2列目のグラフに集中して表示されてしまう。
エラーメッセージは特になし
該当のソースコード
python
1 ''' 全体の設定 ''' 2 sns.set(style="darkgrid") 3 japanize_matplotlib.japanize() 4 fig, axes = plt.subplots(8, 2, figsize = (18,54)) 5 xlabel = "******" 6 ylabel = "******" 7 8 for i in range(8): 9 for j in range(2): 10 title = "*************************" 11 x_column = "*****************" 12 y_column = "*****************" 13 14 axes[i][j].set_title(title) 15 axes[i][j].set_xlabel(xlabel) 16 axes[i][j].set_ylabel(ylabel) 17 sns.scatterplot(x = x_column, y = y_column, data = df, s=60) 18 sns.regplot(x = x_column, y = y_column, data = df) 19 20 plt.show() 21 22 23
試したこと
axes[i][j].sns.scatterplot(x = x_column, y = y_column, data = df, s=60)
とたが、以下のエラー。
'AxesSubplot' object has no attribute 'sns'
補足情報(FW/ツールのバージョンなど)
ここにより詳細な情報を記載してください。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2023/02/17 08:24