我正在使用以下代碼,嘗試將我的熊貓數據框df_in的每列的直方圖繪製爲大圖的子圖。熊貓直方圖:爲每個列繪製直方圖作爲大圖的子圖
%matplotlib notebook
from itertools import combinations
import matplotlib.pyplot as plt
fig, axes = plt.subplots(len(df_in.columns) // 3, 3, figsize=(12, 48))
for x in df_in.columns:
df_in.hist(column = x, bins = 100)
fig.tight_layout()
但是,直方圖並未顯示在子圖中。任何人都知道我錯過了什麼?謝謝!
據我所知,你需要指定''中df_in.hist ax'參數(.. 。,ax = your_ax)' – MaxU