Skip to content

Error bars #1874

Closed
Closed
@mbostock

Description

@mbostock

We should have an easier way to add error bars to a bar, as shown here using a rule and tick:

untitled (93)

Plot.plot({
  marks: [
    Plot.barX(alphabet, {x: "frequency", y: "letter", sort: {y: "-x"}, fill: "steelblue"}),
    Plot.ruleY(alphabet, {x1: (d) => d.frequency * 0.9, x2: (d) => d.frequency * 1.1, y: "letter"}),
    Plot.tickX(alphabet, {x: (d) => d.frequency * 0.9, inset: 6, y: "letter"}),
    Plot.tickX(alphabet, {x: (d) => d.frequency * 1.1, inset: 6, y: "letter"}),
    Plot.ruleX([0])
  ]
})

Ref. #1868 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions