fig, axes = plt.subplots(nrows=1, ncols=3, sharex=False, sharey=False)
df_russel_fee.hist(column='fee', by='fiscal_year',xlabelsize=10,figsize=(0,0),bins=50,ax=axes)
plt.suptitle('Russel fee histogram', x=0.5, y=0.99, ha='center', fontsize='xx-large')
fig.text(0.5, 0.04, 'value', ha='center',fontsize='xx-large')
fig.text(0, 0.5, 'frequency', va='center', rotation='vertical',fontsize='xx-large')
fig = plt.gcf()
fig.set_size_inches(15,6)
Asked
Active
Viewed 55 times
-2

Niels Henkens
- 2,553
- 1
- 12
- 27

Sujeet maurya
- 127
- 1
- 1
- 3
-
You can specify either the total number of bins or the specific bin boundaries with the parameters `bins`. It's currently set to 50 in your code. Try setting it to something lower, like 30. – JoostVn Sep 28 '21 at 06:55
1 Answers
-1
Currently you now specify 50 bins. If you want to increase the WIDTH of the bins (and decrease the NUMBER of bins), you can just specify a lower number of bins (e.g. bins=25
). So change the line to:
df_russel_fee.hist(column='fee', by='fiscal_year',xlabelsize=10, figsize=(0,0),bins=25,ax=axes)
If you want to keep the same number of bins, but make the figures WIDER, you can change the figsize
parameter in the same line. The tuple behind figsize=
specifies (width, height).

Niels Henkens
- 2,553
- 1
- 12
- 27
-
If I don't want to decrease the number of bins I just want to increase the width of the bins – Sujeet maurya Sep 28 '21 at 11:37
-
If you don't decrease the number of bins and you don't widen your figure, then your bins would just overlap and you wouldn't see the individual bars anymore... – Niels Henkens Sep 28 '21 at 11:38