Add option to manually specify the number of bins.