Movatterモバイル変換


[0]ホーム

URL:


  • Overview
  • View Specification
  • Data / Datasets
  • Transform
  • Mark
  • Encoding
  • Projection
  • View Composition
  • Parameter
  • Config

  • Property Types
  • Tooltip
  • Invalid Data
  • Error Band

    Edit this page
    // Single View Specification{  "data": ... ,  "mark": "errorband",  "encoding": ... ,  ...}

    An error band summarizes an error range of quantitative values using a set of summary statistics, representing by area. Error band in Vega-Lite can either be used to aggregate raw data or directly visualize aggregated data.

    To create an error band, setmark to"errorband".

    Documentation Overview

    Error Band Mark Properties

    An error band’s mark definition can contain the following properties:

    PropertyTypeDescription
    typeErrorBand

    Required. The mark type. This could a primitive mark type (one of"bar","circle","square","tick","line","area","point","geoshape","rule", and"text") or a composite mark type ("boxplot","errorband","errorbar").

    extentString

    The extent of the band. Available options include:

    • "ci": Extend the band to the 95% bootstrapped confidence interval of the mean.
    • "stderr": The size of band are set to the value of standard error, extending from the mean.
    • "stdev": The size of band are set to the value of standard deviation, extending from the mean.
    • "iqr": Extend the band to the q1 and q3.

    Default value:"stderr".

    orientString

    Orientation of the error band. This is normally automatically determined, but can be specified when the orientation is ambiguous and cannot be automatically determined.

    colorColor |Gradient |ExprRef

    Default color.

    Default value:"#4682b4"

    Note:

    • This property cannot be used in astyle config.
    • Thefill andstroke properties have higher precedence thancolor and will overridecolor.
    opacityNumber

    The opacity (value between [0,1]) of the mark.

    interpolateString

    The line interpolation method for the error band. One of the following:

    • "linear": piecewise linear segments, as in a polyline.
    • "linear-closed": close the linear segments to form a polygon.
    • "step": a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes at the midpoint of each pair of adjacent x-values.
    • "step-before": a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes before the x-value.
    • "step-after": a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes after the x-value.
    • "basis": a B-spline, with control point duplication on the ends.
    • "basis-open": an open B-spline; may not intersect the start or end.
    • "basis-closed": a closed B-spline, as in a loop.
    • "cardinal": a Cardinal spline, with control point duplication on the ends.
    • "cardinal-open": an open Cardinal spline; may not intersect the start or end, but will intersect other control points.
    • "cardinal-closed": a closed Cardinal spline, as in a loop.
    • "bundle": equivalent to basis, except the tension parameter is used to straighten the spline.
    • "monotone": cubic interpolation that preserves monotonicity in y.
    tensionNumber

    The tension parameter for the interpolation type of the error band.

    Besides the properties listed above,band andborders can be used to specify the underlyingmark properties for differentparts of the error band as well.

    Comparing the usage of Error Band to the usage of Error Bar

    All the properties and usage of error band are identical to error bar’s, except theband andborders that replace the error bar’srule andticks.

    Error Band

    Error Bar

    Using Error Band to Aggregate Raw Data

    If the data is not aggregated yet, Vega-Lite will aggregate the data based on theextent properties in the mark definition as done in theerror band showing confidence interval above. All otherextent values are defined inError Bar.

    Using Error Band to Visualize Aggregated Data

    1. Data is aggregated with low and high values of the error band

    If the data is already pre-aggregated with low and high values of the error band, you can directly specifyx andx2 (ory andy2) to use error band as a ranged mark.

    1. Data is aggregated with center and error value(s)

    If the data is already pre-aggregated with center and error values of the error band, you can usex/y,x/yError, andx/yError2 as defined inError Bar

    Dimension

    Vega-Lite supports both 1D and 2D error bands:

    {:#1d} A1D error band shows the error range of a continuous field; it can be used to show the global error range of the whole plot.

    {:#2d} A2D error band shows the error range of a continuous field for each dimension value such as year.

    The Parts of Error Band

    Under the hood, theerrorband mark is acomposite mark that expands into a layered plot. For example,the basic 2D error band shown above is equivalent to:

    We can customize different parts of the error bandmark definition orconfig.

    For example, we can add the error band’s borders and customize it by settingborders totrue or adding a mark property toborders, such asstrokeDash andopacity:

    Color, and Opacity Encoding Channels

    You can customize the color, size, and opacity of the band in theerrorband by using thecolor, andopacityencoding channels, which applied to the wholeerrorband.

    Here is an example of aerrorband with thecolor encoding channel set to{"value": "black"}.

    Tooltip Encoding Channels

    You can add custom tooltips to error bands. The custom tooltip will override the default error band’s tooltips.

    Mark Config

    {  "errorband": {    "extent": ...,    "band": ...,    "borders": ...  }}

    Theerrorband config object sets the default properties forerrorband marks.

    The error band config can contain allerror band mark properties but currently not supportingcolor,opacity, andorient. Please see issue#3934.


[8]ページ先頭

©2009-2025 Movatter.jp