Skip to content

The box mark could use bin/rect instead of group/bar for quantitative data #1330

Open
@mbostock

Description

@mbostock

As an approximation:

Plot.plot({
  marks: [
    Plot.ruleX(data, Plot.binX({y1: loqr1, y2: hiqr2}, {x, y})),
    Plot.rectY(data, Plot.binX({y1: "p25", y2: "p75"}, {x, y, fill: "#ccc"})),
    Plot.ruleY(data, Plot.binX({y: "p50"}, {x, y, strokeWidth: 2})),
    Plot.dot(data, Plot.map({y: oqr}, {x, y, z: ???}))
  ]
})

I couldn’t figure out how to compute the per-bin outliers, though. Maybe we need a Plot.binmapX transform where z can be imputed by binning x? Or maybe there’s a way to compose the bin and map transform? 🤔

Ref. https://talk.observablehq.com/t/how-to-label-a-boxplot-with-dates-format-axis/7739/3

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