AnyMath 文档

箱线图

该页面正在翻译中。

boxplot(x, y; kwargs...)

绘制Tukey风格的箱线图。 箱线图有3个组件:

  • a 横杆,横杆 跨越四分位间(IQR)范围,中线标记中位数

  • 一个 错误,错误 谁的胡须跨度 范围*iqr

  • 标记异常值的点,即晶须之外的数据

论点

  • x:类别的位置

  • y:框内的变量

地块类型

绘图类型别名 箱线图 功能是 箱线图.

例子:

</无翻译>

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

boxplot(categories, values)
a5ce6db

</无翻译>

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

boxplot(categories, values, dodge = dodge, show_notch = true, color = dodge)
47b81cb

颜色是可定制的。 该 颜色 属性是指框的颜色,而 异常颜色 指异常值的颜色。 如果不是标量(例如 :红色),这些属性必须具有数据的长度。 如果 异常颜色 不提供,异常值将具有与它们的框相同的颜色,如上所示。

同一框内对应点的所有索引的注释, 颜色 (但不是 异常颜色)必须具有相同的值。

</无翻译>

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

boxplot(categories, values, dodge = dodge, show_notch = true, color = map(d->d==1 ? :blue : :red, dodge) , outliercolor = rand([:red, :green, :blue, :black, :yellow], 1000))
6d1ec16

使用统计权重

</无翻译>

using CairoMakie
using Distributions

N = 100_000
x = rand(1:3, N)
y = rand(Uniform(-1, 5), N)

w = pdf.(Normal(), x .- y)

图=图()

箱线图(图[1,1],x,y)
箱线图(图[1,2],x,y,权重=w)

无花果
14b5b28

水平轴

</无翻译>

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
boxplot!(ax_vert, categories, values) # `orientation=:vertical` is default
boxplot!(ax_horiz, categories, values; orientation=:horizontal)

fig
17fb267

属性

颜色

默认值为 @继承patchcolor

没有可用的文档。

颜色表

默认值为 @继承colormap

没有可用的文档。

颜色变化

默认值为 自动的

没有可用的文档。

色阶;色阶

默认值为 身份认同

没有可用的文档。

周期

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

没有可用的文档。

道奇

默认值为 自动的

的向量 整数 (数据长度)分组变量以同时创建多个并排框 x 位置。

dodge_gap

默认值为 0.03

闪避盒之间的间距。

差距

默认值为 0.2

收缩因子, 宽度->宽度*(1-间隙).

可检查的

默认值为 @继承inspectable

没有可用的文档。

标记物

默认值为 @继承标记

没有可用的文档。

标记大小

默认值为 @继承markersize

没有可用的文档。

[医]中色

默认值为 @继承linecolor

没有可用的文档。

中度线宽

默认值为 @继承线宽

没有可用的文档。

n_dodge的

默认值为 自动的

没有可用的文档。

n.宽度

默认值为 0.5

乘数 阔度 为槽口的最窄宽度。

方向感

默认值为 :垂直

盒子的方向(:垂直:水平).

异常颜色

默认值为 自动的

没有可用的文档。

异常色,异常色

默认值为 @继承markerstrokecolor

没有可用的文档。

离群行程宽度

默认值为 @继承markerstrokewidth

没有可用的文档。

范围

默认值为 1.5

IQR控制晶须长度的倍数。

[医]显示

默认值为 真的

显示中位数为中线。

n.表演,表演

默认值为 错误

划出缺口。

显示值

默认值为 真的

将异常值显示为点。

[医]斯特罗克色

默认值为 @继承patchstrokecolor

没有可用的文档。

斯特罗克威德斯

默认值为 @继承patchstrokewidth

没有可用的文档。

重量

默认值为 自动的

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

[医]威士忌

默认值为 @继承linecolor

没有可用的文档。

n.晶须,晶须

默认值为 @继承线宽

没有可用的文档。

晶须宽度

默认值为 0.0

乘数 阔度 对于晶须上的T的宽度,或 :比赛 要匹配 阔度.

阔度

默认值为 自动的

收缩前盒的宽度。