Getting bin values from histogram

I wish to get the values of the bins in a histogram I make using Plots.jl. For example, if I use the following sample code

using Plots

data = randn(100)
histogram(data, normalize=:probability)

I wish to learn what the y-values are of each bin. Is there a way for me to do that?

using StatsBase, LinearAlgebra

h = normalize(fit(Histogram, randn(100)), mode=:probability)

gives you a structure h with components edges and weights.

1 Like