How to change the figure size of Dataframe.hist for pandas 0.11.0
Question:
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.
Answers:
Let’s try something like this:
fig = plt.figure(figsize = (15,20))
ax = fig.gca()
df.hist(ax = ax)
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);
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.
Let’s try something like this:
fig = plt.figure(figsize = (15,20))
ax = fig.gca()
df.hist(ax = ax)
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);