Engee 文档

小提琴

该页面正在翻译中。

violin(x, y)

绘制小提琴情节。

论点

  • x:类别的位置

  • y:计算密度的变量

地块类型

绘图类型别名 小提琴 功能是 小提琴.

例子:

</无翻译>

using CairoMakie
categories = rand(1:3, 1000)
values = randn(1000)

violin(categories, values)
dad458c

</无翻译>

using CairoMakie
fig = Figure()
xs = vcat([fill(i, i * 1000) for i in 1:4]...)
ys = vcat(randn(6000), randn(4000) * 2)
for (i, scale) in enumerate([:area, :count, :width])
    ax = Axis(fig[i, 1])
    violin!(ax, xs, ys; scale, show_median=true)
    Makie.xlims!(0.2, 4.8)
    ax.title = "scale=:$(scale)"
end
fig
321a106

</无翻译>

using CairoMakie
categories = rand(1:3, 1000)
values = map(categories) do x
    return x == 1 ? randn() : x == 2 ? 0.5 * randn() : 5 * rand()
end

violin(categories, values, datalimits = extrema)
538e473

</无翻译>

using CairoMakie
N = 1000
categories = rand(1:3, N)
dodge = rand(1:2, N)
side = rand([:left, :right], N)
color = @. ifelse(side === :left, :orange, :teal)
values = map(side) do s
    return s === :left ? randn() : rand()
end

violin(categories, values, dodge = dodge, side = side, color = color)
1589f83

</无翻译>

using CairoMakie
N = 1000
categories = rand(1:3, N)
side = rand([:left, :right], N)
color = map(categories, side) do x, s
    colors = s === :left ? [:red, :orange, :yellow] : [:blue, :teal, :cyan]
    return colors[x]
end
values = map(side) do s
    return s === :left ? randn() : rand()
end

violin(categories, values, side = side, color = color)
957faa0

使用统计权重

</无翻译>

using CairoMakie
using Distributions

N = 100_000
categories = rand(1:3, N)
values = rand(Uniform(-1, 5), N)

w = pdf.(Normal(), categories .- values)

fig = Figure()

violin(fig[1,1], categories, values)
violin(fig[1,2], categories, values, weights = w)

fig
b258fd9

水平轴

</无翻译>

using CairoMakie
fig = Figure()

categories = rand(1:3, 1000)
values = randn(1000)

ax_vert = Axis(fig[1,1];
    xlabel = "categories",
    ylabel = "values",
    xticks = (1:3, ["one", "two", "three"])
)
ax_horiz = Axis(fig[1,2];
    xlabel="values", # note that x/y still correspond to horizontal/vertical axes respectively
    ylabel="categories",
    yticks=(1:3, ["one", "two", "three"])
)

# Note: same order of category/value, despite different axes
violin!(ax_vert, categories, values) # `orientation=:vertical` is default
violin!(ax_horiz, categories, values; orientation=:horizontal)

fig
ab4b60e

属性

带宽

默认值为 自动的

没有可用的文档。

边界

默认值为 自动的

没有可用的文档。

夹式飞机

默认值为 自动的

剪辑平面提供了一种在3D空间中进行剪辑的方法。 您可以设置最多8个向量 平面3f 飞机在这里,后面的情节将被裁剪(即变得不可见)。 默认情况下,剪辑平面继承自父绘图或场景。 您可以删除父 夹式飞机 通过传递 平面3f[].

颜色

默认值为 @继承patchcolor

没有可用的文档。

周期

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

没有可用的文档。

数据集

默认值为 (-Inf,Inf)

指定要修剪的值 小提琴. 可以是一个 元组 或一个 功能 (例如 datalimits=极值).

depth_换档

默认值为 0.0

在所有其他变换之后(即在剪辑空间中)调整绘图的深度值,其中 0<=深度<=1. 这仅适用于GLMakie和WGLMakie,可用于调整渲染顺序(如可调谐透绘)。

道奇

默认值为 自动的

没有可用的文档。

dodge_gap

默认值为 0.03

没有可用的文档。

外汇管理局

默认值为 真的

调整绘图是否使用fxaa(抗锯齿,仅限GLMakie)渲染。

差距

默认值为 0.2

收缩系数, 宽度->宽度*(1-间隙).

可检查的

默认值为 @继承inspectable

设置此图是否应由 数据探测仪. 默认值取决于父场景的主题。

检查员-检查员

默认值为 自动的

设置回调函数 (检查员,情节)->。.. 用于清理DataInspector中的自定义指标。

检查员-检查员

默认值为 自动的

设置回调函数 (检查员,情节,索引)->。.. 它取代了默认值 显示_数据 方法。

检查器_label

默认值为 自动的

设置回调函数 (绘图、索引、位置)->字符串 它替换了DataInspector生成的默认标签。

最大密度

默认值为 自动的

没有可用的文档。

[医]中色

默认值为 @继承linecolor

没有可用的文档。

中度线宽

默认值为 @继承线宽

没有可用的文档。

模型

默认值为 自动的

为绘图设置模型矩阵。 这将复盖使用 翻译!, 旋转!规模!.

n_dodge的

默认值为 自动的

没有可用的文档。

n点

默认值为 200

没有可用的文档。

方向感

默认值为 :垂直

小提琴的方向(:垂直:水平)

透支

默认值为 错误

控制绘图是否将绘制在其他绘图上。 这具体意味着忽略GL后端中的深度检查

比例尺

默认值为 :地区

按面积划分的尺度密度(:地区),计数(:计数),或宽度(:宽度).

[医]显示

默认值为 错误

显示中位数为中线。

侧面

默认值为 :两者兼而有之

指定 :左:对 只把小提琴画在一边.

空间

默认值为 :数据

设置包含情节的盒子的变换空间。 见 麦琪空间() 供可能的输入。

ssao

默认值为 错误

调整是否使用ssao(屏幕空间环境光遮蔽)渲染绘图。 请注意,这仅在3D绘图中有意义,并且仅适用于 fxaa=真.

[医]斯特罗克色

默认值为 @继承patchstrokecolor

没有可用的文档。

斯特罗克威德斯

默认值为 @继承patchstrokewidth

没有可用的文档。

转型

默认值为 :自动

没有可用的文档。

透明度

默认值为 错误

调整情节处理透明度的方式。 在GLMakie 透明度=真 导致使用顺序独立的透明度。

可见

默认值为 真的

控制是否渲染绘图。

重量

默认值为 自动的

统计权重(数据长度)的向量。 默认情况下,每个观测值都有权重 1.

阔度

默认值为 自动的

收缩前盒的宽度。