altair.BoxPlotDef#
- class altair.BoxPlotDef(type=Undefined, box=Undefined, clip=Undefined, color=Undefined, extent=Undefined, invalid=Undefined, median=Undefined, opacity=Undefined, orient=Undefined, outliers=Undefined, rule=Undefined, size=Undefined, ticks=Undefined, **kwds)#
BoxPlotDef schema 包装器。
- 参数:
- type
BoxPlot
, Literal[‘boxplot’] 标记类型。这可以是原始标记类型(
"bar"
,"circle"
,"square"
,"tick"
,"line"
,"area"
,"point"
,"geoshape"
,"rule"
, 和"text"
之一)或复合标记类型("boxplot"
,"errorband"
,"errorbar"
)。- boxbool, dict,
BarConfig
,AreaConfig
,LineConfig
,MarkConfig
,RectConfig
,TickConfig
,AnyMarkConfig
- clipbool
复合标记是否被剪裁到封闭组的宽度和高度。
- colorstr, dict,
Color
,ExprRef
,Gradient
,HexColor
,ColorName
,LinearGradient
,RadialGradient
, Literal[‘black’, ‘silver’, ‘gray’, ‘white’, ‘maroon’, ‘red’, ‘purple’, ‘fuchsia’, ‘green’, ‘lime’, ‘olive’, ‘yellow’, ‘navy’, ‘blue’, ‘teal’, ‘aqua’, ‘orange’, ‘aliceblue’, ‘antiquewhite’, ‘aquamarine’, ‘azure’, ‘beige’, ‘bisque’, ‘blanchedalmond’, ‘blueviolet’, ‘brown’, ‘burlywood’, ‘cadetblue’, ‘chartreuse’, ‘chocolate’, ‘coral’, ‘cornflowerblue’, ‘cornsilk’, ‘crimson’, ‘cyan’, ‘darkblue’, ‘darkcyan’, ‘darkgoldenrod’, ‘darkgray’, ‘darkgreen’, ‘darkgrey’, ‘darkkhaki’, ‘darkmagenta’, ‘darkolivegreen’, ‘darkorange’, ‘darkorchid’, ‘darkred’, ‘darksalmon’, ‘darkseagreen’, ‘darkslateblue’, ‘darkslategray’, ‘darkslategrey’, ‘darkturquoise’, ‘darkviolet’, ‘deeppink’, ‘deepskyblue’, ‘dimgray’, ‘dimgrey’, ‘dodgerblue’, ‘firebrick’, ‘floralwhite’, ‘forestgreen’, ‘gainsboro’, ‘ghostwhite’, ‘gold’, ‘goldenrod’, ‘greenyellow’, ‘grey’, ‘honeydew’, ‘hotpink’, ‘indianred’, ‘indigo’, ‘ivory’, ‘khaki’, ‘lavender’, ‘lavenderblush’, ‘lawngreen’, ‘lemonchiffon’, ‘lightblue’, ‘lightcoral’, ‘lightcyan’, ‘lightgoldenrodyellow’, ‘lightgray’, ‘lightgreen’, ‘lightgrey’, ‘lightpink’, ‘lightsalmon’, ‘lightseagreen’, ‘lightskyblue’, ‘lightslategray’, ‘lightslategrey’, ‘lightsteelblue’, ‘lightyellow’, ‘limegreen’, ‘linen’, ‘magenta’, ‘mediumaquamarine’, ‘mediumblue’, ‘mediumorchid’, ‘mediumpurple’, ‘mediumseagreen’, ‘mediumslateblue’, ‘mediumspringgreen’, ‘mediumturquoise’, ‘mediumvioletred’, ‘midnightblue’, ‘mintcream’, ‘mistyrose’, ‘moccasin’, ‘navajowhite’, ‘oldlace’, ‘olivedrab’, ‘orangered’, ‘orchid’, ‘palegoldenrod’, ‘palegreen’, ‘paleturquoise’, ‘palevioletred’, ‘papayawhip’, ‘peachpuff’, ‘peru’, ‘pink’, ‘plum’, ‘powderblue’, ‘rosybrown’, ‘royalblue’, ‘saddlebrown’, ‘salmon’, ‘sandybrown’, ‘seagreen’, ‘seashell’, ‘sienna’, ‘skyblue’, ‘slateblue’, ‘slategray’, ‘slategrey’, ‘snow’, ‘springgreen’, ‘steelblue’, ‘tan’, ‘thistle’, ‘tomato’, ‘turquoise’, ‘violet’, ‘wheat’, ‘whitesmoke’, ‘yellowgreen’, ‘rebeccapurple’] 默认颜色。
默认值: ■
"#4682b4"
注意
此属性不能用于样式配置。
fill
和stroke
属性优先级高于color
,并将覆盖color
。
- extentfloat, Literal[‘min-max’]
须的范围。可用选项包括
"min-max"
: min 和 max 分别是下须和上须。表示四分位距倍数的一个数字。此数字将乘以 IQR 来确定须的边界,边界范围从最小数据到范围内 [Q1 - k * IQR, Q3 + k * IQR] 的最大数据,其中 Q1 和 Q3 是第一和第三四分位数,而 IQR 是四分位距 (Q3-Q1)。
默认值:
1.5
。- invalid
MarkInvalidDataMode
, Literal[‘filter’, ‘break-paths-filter-domains’, ‘break-paths-show-domains’, ‘break-paths-show-path-domains’, ‘show’], None 无效数据模式,定义标记和相应的比例尺应如何表示无效值(连续比例尺中未定义无效值输出时的
null
和NaN
)。"filter"
— 从可视化的*标记*和*比例尺*中*排除*所有无效值。对于路径标记(line、area、trail),此选项将创建连接有效点的路径,就好像包含无效值的数据行不存在一样。"break-paths-filter-domains"
— 在无效值处断开路径标记(line、area、trail)。对于非路径标记,这等同于"filter"
。所有*比例尺*域将*排除*这些被过滤的数据点。"break-paths-show-domains"
— 在无效值处断开路径(line、area、trail)。隐藏非路径标记的无效值。所有*比例尺*域将*包含*这些被过滤的数据点(对于路径和非路径标记)。"show"
或null
— 在标记和比例尺域中显示所有数据点。每个比例尺将使用config.scale.invalid
中定义的无效值输出,如果未指定,默认情况下,无效值将产生与零相同的视觉值(如果比例尺包含零)或最小值(如果比例尺不包含零)。"break-paths-show-path-domains"
(默认) — 这等同于基于路径的标记(line/area/trail)的"break-paths-show-domains"
,以及非路径标记的"filter"
。
注意: 如果任何通道的比例尺在
config.scale.invalid
中定义了无效值的输出,则所有比例尺的值都将被视为“有效”,因为它们可以为比例尺产生合理的输出。因此,此类通道的字段将不会被过滤,也不会导致路径断开。- medianbool, dict,
BarConfig
,AreaConfig
,LineConfig
,MarkConfig
,RectConfig
,TickConfig
,AnyMarkConfig
- opacityfloat
标记的不透明度(介于 [0,1] 之间的值)。
- orient
Orientation
, Literal[‘horizontal’, ‘vertical’] 箱线图的方向。这通常根据 x 和 y 通道上字段的类型自动确定。但是,当方向不明确时,可以指定显式的
orient
。默认值:
"vertical"
。- outliersbool, dict,
BarConfig
,AreaConfig
,LineConfig
,MarkConfig
,RectConfig
,TickConfig
,AnyMarkConfig
- rulebool, dict,
BarConfig
,AreaConfig
,LineConfig
,MarkConfig
,RectConfig
,TickConfig
,AnyMarkConfig
- sizefloat
箱线图的箱体和中位数刻度的大小
- ticksbool, dict,
BarConfig
,AreaConfig
,LineConfig
,MarkConfig
,RectConfig
,TickConfig
,AnyMarkConfig
- type
- __init__(type=Undefined, box=Undefined, clip=Undefined, color=Undefined, extent=Undefined, invalid=Undefined, median=Undefined, opacity=Undefined, orient=Undefined, outliers=Undefined, rule=Undefined, size=Undefined, ticks=Undefined, **kwds)#
方法
__init__
([type, box, clip, color, extent, ...])copy
([deep, ignore])返回对象的副本。
from_dict
(dct[, validate])从字典表示构造类。
from_json
(json_string[, validate])从有效的 JSON 字符串实例化对象。
resolve_references
([schema])在此对象的 schema 或根 schema 上下文中解析引用。
to_dict
([validate, ignore, context])返回对象的字典表示。
to_json
([validate, indent, sort_keys, ...])将此对象的 JSON 表示作为字符串发出。
validate
(instance[, schema])在 rootschema 上下文中验证实例与类 schema 的一致性。
validate_property
(name, value[, schema])在 rootschema 上下文中验证属性与属性 schema 的一致性。