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 模式包装器。
- Parameters:
- 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,
颜色,ExprRef,渐变,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"— 排除 所有无效值,从可视化的 标记 和 刻度 中。对于路径标记(如线、面积、轨迹),此选项将创建连接有效点的路径,仿佛具有无效值的数据行不存在。"break-paths-filter-domains"— 在无效值处断开路径标记(用于线、区域、轨迹)。对于非路径标记,这等同于"filter"。所有 scale 域将 排除 这些被过滤的数据点。"break-paths-show-domains"— 在无效值处断开路径(用于线、区域、轨迹)。 对于非路径标记隐藏无效值。 所有 scale 域将 包括 这些过滤的数据点(对于路径和非路径标记)。"show"或null— 显示标记和尺度域中的所有数据点。每个尺度将使用在config.scale.invalid中定义的无效值的输出,或者,如果未指定,默认情况下无效值将产生与零相同的视觉值(如果尺度包括零)或最小值(如果尺度不包括零)。"break-paths-show-path-domains"(默认)— 这相当于"break-paths-show-domains"用于基于路径的标记(线/区域/轨迹)以及"filter"用于非路径标记。
注意:如果任何通道的尺度在
config.scale.invalid中定义了无效值的输出,那么该尺度的所有值将被视为“有效”,因为它们可以为尺度产生合理的输出。因此,这种通道的字段将不会被过滤,也不会导致路径中断。- medianbool, dict,
BarConfig,AreaConfig,LineConfig,MarkConfig,RectConfig,TickConfig,AnyMarkConfig - opacityfloat
标记的透明度(值介于 [0,1] 之间)。
- orient
方向, 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__([类型, 框, 剪裁, 颜色, 范围, ...])copy([深度, 忽略])返回对象的副本。
from_dict(dct[, validate])从字典表示构造类。
from_json(json_string[, validate])从有效的 JSON 字符串实例化对象。
resolve_references([schema])解析此对象的架构或根架构中的引用。
to_dict([validate, ignore, context])返回对象的字典表示。
to_json([validate, indent, sort_keys, ...])以字符串形式输出该对象的 JSON 表示。
validate(instance[, schema])在rootschema的上下文中验证实例是否符合类模式。
validate_property(name, value[, schema])在根架构的上下文中,根据属性架构验证一个属性。