How to draw histogram of a sine?


I want to draw the figure like this in Julia Plots. Is there any package I could use? Need suggestion.

One example using Plots.jl and Distributions.jl:

using Plots, Distributions
x = 0:0.01:100
y1 = sin.(x)
y2 = rand(Normal(0,0.3),length(x))
p1 = plot(x, y1)
p2 = histogram(y1, nbins=-1:0.1:1)
p3 = plot(x, y2)
p4 = histogram(y2, nbins=-1:0.1:1)
plot(p1,p3,p2,p4, layout=(2,2))
1 Like

It helps a lot. Thanks