1

I am drawing some grouped histograms in python as per this question, but am trying to plot more histograms and make them bigger.

To give an example:

from pandas import DataFrame
import numpy as np
x = ['A']*300 + ['B']*400 + ['C']*300 + ['D']*400 + ['E']*200 + ['F']*500 + 
['G']*400 + ['H']*500 + ['I']*300
y = np.random.randn(3300)
df = DataFrame({'Letter':x, 'N':y})
grouped = df.groupby('Letter')

I then plot like this in Jupyter:

%matplotlib inline
df['N'].hist(by=df['Letter'])

but the plots come out really small. How do I increase the size so they fill the page?

prmlmu
  • 643
  • 1
  • 8
  • 16

1 Answers1

7

It wasn't that difficult:

df['N'].hist(by=df['Letter'], figsize = (16,18))
prmlmu
  • 643
  • 1
  • 8
  • 16
  • note: the values after figsize must be in parenthesis and mean `(width, heigth)`. Another method would be before `df['N'].hist()` a line with `plt.figure(figsize=(16,8))` if you had previously imported `import matplotlib.pyplot as plt`, that is. – mrbTT Dec 05 '18 at 12:39