Engee 文档

密度

该页面正在翻译中。

density(values)

绘制核密度估计值 价值.

绘图类型

绘图类型别名 密度 功能是 密度.

例子:

</无翻译>

using CairoMakie
f = Figure()
Axis(f[1, 1])

density!(randn(200))

f
3f54976

</无翻译>

using CairoMakie
f = Figure()
Axis(f[1, 1])

density!(randn(200), direction = :y, npoints = 10)

f
be2c2c2

</无翻译>

using CairoMakie
f = Figure()
Axis(f[1, 1])

density!(randn(200), color = (:red, 0.3),
    strokecolor = :red, strokewidth = 3, strokearound = true)

f
cc5ee88

</无翻译>

using CairoMakie
f = Figure()
Axis(f[1, 1])

vectors = [randn(1000) .+ i/2 for i in 0:5]

for (i, vector) in enumerate(vectors)
    density!(vector, offset = -i/4, color = (:slategray, 0.4),
        bandwidth = 0.1)
end

f
4fecd1b

渐变

您可以通过选择具有渐变的颜色密度图 颜色=:x:y,取决于 方向感 属性。 </无翻译>

using CairoMakie
months = ["January", "February", "March", "April",
    "May", "June", "July", "August", "September",
    "October", "November", "December"]

f = Figure()
Axis(f[1, 1], title = "Fictive temperatures",
    yticks = ((1:12) ./ 4,  reverse(months)))

for i in 12:-1:1
    d = density!(randn(200) .- 2sin((i+3)/6*pi), offset = i / 4,
        color = :x, colormap = :thermal, colorrange = (-5, 5),
        strokewidth = 1, strokecolor = :black)
    # this helps with layering in GLMakie
    translate!(d, 0, 0, -0.1i)
end
f
6e593b3

由于技术限制,如果您对 :垂直 尺寸(或:水平方向=:y),只有一个只有两种颜色的颜色表目前可以工作: </无翻译>

using CairoMakie
f = Figure()
Axis(f[1, 1])
for x in 1:5
    d = density!(x * randn(200) .+ 3x,
        color = :y, colormap = [:darkblue, :gray95])
end
f
6c4748a

使用统计权重

</无翻译>

using CairoMakie
using Distributions


N = 100_000
x = rand(Uniform(-2, 2), N)

w = pdf.(Normal(), x)

fig = Figure()
density(fig[1,1], x)
density(fig[1,2], x, weights = w)

fig
585b054

属性

带宽

默认值为 自动的

内核密度带宽,如果自动确定 自动的.

边界

默认值为 自动的

密度估计的边界,如果自动确定 自动的.

颜色

默认值为 @继承patchcolor

通常设置为单一颜色,但也可以设置为 :x:y 用渐变来着色。 如果您使用 :y 何时 方向=:x (反之亦然),请注意,只有2元素颜色表才能正常工作。

颜色表

默认值为 @继承colormap

没有可用的文档。

颜色变化

默认值为 麦琪自动的

没有可用的文档。

色阶;色阶

默认值为 身份认同

没有可用的文档。

周期

默认值为 [:颜色=>:补丁颜色]

没有可用的文档。

方向感

默认值为 :x

沿其尺寸 价值 被分布。 可以是 :x:y.

可检查的

默认值为 @继承inspectable

没有可用的文档。

林泳,林泳

默认值为 什么都没有

没有可用的文档。

n点

默认值为 200

沿维度集的估计曲线的分辨率 方向感.

偏移量

默认值为 0.0

移密度基线,用于在彼此之上分层多个密度。

鹿strokearound

默认值为 错误

没有可用的文档。

[医]斯特罗克色

默认值为 @继承patchstrokecolor

没有可用的文档。

斯特罗克威德斯

默认值为 @继承patchstrokewidth

没有可用的文档。

重量

默认值为 自动的

将统计权重的向量分配给 价值.