0

I'm trying to make a histogram for all the columns in a table. When I do that, they all overlap and I can't read any of them. I have tried to change fig size, but I would just like them to display neatly /legibly. Is there a way to do this with over 80 columns?

If not, can you recommend a better way to do all 80+ histograms? Thanks in advance!

df.hist(figsize = (15, 10))

Here is what it looks like on my sideenter image description here

  • increase `figsize` and or change the `layout=` parameter. (1) `ax = df.hist(figsize=(28, 20), layout=(7, 4), sharey=True, sharex=True)` (2) `axes = axes.flat` (3) `fig = axes[0].get_figure()` (4) `fig.tight_layout()` – Trenton McKinney Nov 27 '21 at 17:06
  • This [answer](https://stackoverflow.com/a/70137133/7758804) of the duplicate. – Trenton McKinney Nov 27 '21 at 17:33
  • with 80 subplots it might be better to plot the columns in groups of 20, with a layout of (4, 5) or (5, 4). Select groups of columns with `.iloc`: `df.iloc[:, 0:20].plot(kind='hist',...)`, `df.iloc[:, 20:40].plot(kind='hist',...)`, ... – Trenton McKinney Nov 27 '21 at 17:46
  • 1
    TrentonMcKinney thank you! I will do that instead. – Kristin Nov 28 '21 at 18:27

0 Answers0