I would like to add a density curve to a histogram while keeping the y-axis with count values. The answer on this forum describes how to add a density curve to a histogram but with the probability on the y-axis. Here is the code:
Pkg.add("Plots")
Pkg.add("Distributions")
using Distributions, Plots
dist = Normal(0, 1)
data = rand(dist, 1000)
histogram(data, normalize=true)
plot!(x->pdf(dist, x), xlim=xlims())
Output:
It nicely creates the histogram with a density curve and density y-axis. But I was wondering if anyone knows how to add a density curve to a histogram while keeping the y-axis as count values in Julia
?