FHist.jl
FHist.jl copied to clipboard
[FR] Plotting recipe for a curve over a histogram
trafficstars
I worked on plotting the recipe and dispatch in Plots.jl using Hist1D.
The recipe might below on this package
- model with data:
WithDataobject, and
data = randn(1000);
h = Hist1D(data; binedges=range(-5,5, 100));
model_fun(x) = length(data) * exp(-x^2 / 2) / sqrt(2π);
plot(h, seriestype=:stepbins)
plot!(model_fun, WithData(h.binedges[1]), lw=2)
curvedfitwithpullsfor distribution with the pulls
data = log.(1 .+ (exp(1) - 1) .* rand(n))
best_model(x) = exp(x) / (exp(1)-1)
h = Hist1D(data; binedges=1.1:0.1:2.5))
curvedfitwithpulls(h0, best_model, xlab = "X-axis", ylab = "Y-axis")