I am using Plots.jl to make a histogram. I would like to have control over the bin size, but I can’t seem to find anything specifically saying how to do this in the documentation (or in other posts).
I have an array with all integer values in it, and I would like to create a histogram with bins with a width of exactly 1. I would expect that there is something similar to this that works:
Have you tried the auto-binning algorithms( :sturges, :sqrt, :rice, :scott, :fd) ?
In your sample “:sqrt”-shows the same histogram
using Plots
data = rand(0:100, 10000) # 1D Array with data
plot(
histogram(data; bins = 0:1:100 ), # Creates the histogram
histogram(data, bins=:sqrt);
layout=(2,1))