AbhiGupta
AbhiGupta

Reputation: 503

How to change the figure size of Dataframe.hist for pandas 0.11.0

I am trying to make histograms for a dataframe with pandas 0.11.0 but the figure size is too small. How to change it?

In pandas 0.19.0, hist has the figsize parameter.

Upvotes: 31

Views: 47538

Answers (2)

cottontail
cottontail

Reputation: 23041

As mentioned in the OP, since pandas 0.15.0, df.hist(figsize=(15, 20)) or df.plot(kind='hist', figsize=(15, 20)) is possible. Another way is to create a subplot and set figure size.

fig, ax = plt.subplots(1, figsize=(15, 20))
df.plot(kind='hist', ax=ax);

Upvotes: 1

Scott Boston
Scott Boston

Reputation: 153460

Let's try something like this:

   fig = plt.figure(figsize = (15,20))
   ax = fig.gca()
   df.hist(ax = ax)

Upvotes: 77

Related Questions