hist + pdf = density
using CairoMakie, Random
Random.seed!(13)
n = 3000
data = randn(n)
fig = Figure(resolution = (600, 400))
ax1 = Axis(fig[1, 1], xlabel = "value")
hist!(ax1, data; normalization = :pdf, color = (:green, 0.5), label = "hist & pdf")
density!(ax1, data; color = (:orange, 0.25), label = "density!", strokewidth = 1)
axislegend(ax1, position = :rt)
fig
Warning
This example was autogenerated using:
using Pkg
Pkg.status(["CairoMakie"])
Status `~/work/BeautifulMakie/BeautifulMakie/docs/Project.toml`
[13f3f980] CairoMakie v0.10.6
This page was generated using Literate.jl.