Calculate optimalBounds from bins
Use optimalBounds for plotting of histograms