
I have a list of Pandas dataframes stored in dfs and I am plotting a grid (three columns) of histograms:
hists = [Histogram(dfs[colname],
title=colname,
bins=20,
) for colname in dfs.columns]
for h in hists:
h.x_range = Range1d(-20, 20)
ncol = 3
hists = [hists[i:i+ncol] for i in range(0,len(hists),ncol)]
p = gridplot(hists)
However, I’ve noticed that while the number of bins (20) are the same in all of the plots, the width and location of each bin is inconsistent from plot to plot. I believe this is because each plot has a different x_range and the bins are generated using some optimized method. Instead, I’d like to be able to specify the width and location of each bin, maybe in the form of a list of tuples or something:
bins = [(-20, -15), (-15, -10), (-10, -5), (-5, 0), (0, 5), (5, 10), (10, 15), (15, 20)]
Also, notice that I’ve set my x_range to (-20, 20) so I know my min/max are from all of the plots.
