# Julia - How to plot a histogram with density as the vertical axis (中怎么绘制密度为纵轴的直方图)

1、julia怎么绘制直方图，纵轴为密度，然后拟合密度曲线
2、julia怎么绘制正态分布曲线？
3.或者julia对于r里的ggplot的…density…会无法识别要怎么修改？以下是我的r代码
ggplot(data, aes_string(x=“V5”)) +
geom_histogram(aes(y=…density…), # 这一步很重要,使用density代替y轴
binwidth=1,
colour=“black”, fill=“white”)
4、julia怎么用ggplot画正态分布曲线

1 Like

1. How to draw a histogram in julia, the vertical axis is density, and then fit the density curve
2. How does julia draw a normal distribution curve?
3. Or how to modify julia for ggplot in r…density…will not recognize how to modify it? Below is my r code
ggplot(data, aes_string(x=“V5”)) +
geom_histogram(aes(y=…density…), # This step is very important, use density instead of y axis
binwidth=1,
colour=“black”, fill=“white”)
4. How to use ggplot to draw a normal distribution curve in julia

I would suggest

https://juliaplots.org/AlgebraOfGraphics.jl/dev/generated/analyses/#Density

https://makie.juliaplots.org/stable/examples/plotting_functions/density/

2 Likes