pandas histogram: plot histogram for each column as subplot of a big figure
<p>I am using the following code, trying to plot the histogram of every column of a my pandas data frame df_in as subplot of a big figure.</p>

<pre><code>%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()
</code></pre>

<p>However, the histogram didn't show in the subplot. Any one knows what I missed? Thanks!</p>

<p>You need to specify which axis you are plotting to. This should work:</p>

<pre><code>fig, axes = plt.subplots(len(df_in.columns)//3, 3, figsize=(12, 48))
for col, axis in zip(df_in.columns, axes):
    df_in.hist(column = col, bins = 100, ax=axis)
</code></pre>

python pandas histogram