Minimal call
df = {"x": [1, 2, 3, 4, 5, 6],
"y": [2.1, 3.4, 4.0, 3.8, 5.1, 6.2],
"sd": [0.4, 0.3, 0.6, 0.5, 0.4, 0.7]}
c = pt.chart(df, aes(x="x", y="y", yerr="sd"), xlabel="x", ylabel="y")
c.add_errorbar()
Docstring
Points with vertical (and/or horizontal) error bars and optional caps.
Long-form table input:
c.add_errorbar(aes(x="cat", y="mean", yerr="sd")) # offset (sym)
c.add_errorbar(aes(x="cat", y="mean"), yerr=0.5) # scalar offset
c.add_errorbar(aes(x="cat", y="mean"), yerr=("lo", "hi")) # offset (asym)
c.add_errorbar(aes(x="cat", y="mean", ymin="lo", ymax="hi")) # absolute bounds
c.add_errorbar(aes(x="t", y="mean", xerr="terr", yerr="sd")) # both axes
c.add_errorbar(aes(x="cat", y="mean", yerr="sd", color="series")) # grouped
`yerr` / `xerr`: a single column maps in aes; an asymmetric
`(lower, upper)` tuple of column names stays a bare kwarg (aes takes
single column names only) and each element is read off the data.
A bare scalar (or scalar tuple) is a literal offset. `ymin`/`ymax`
(and `xmin`/`xmax`) map columns in aes for absolute bounds and are
mutually exclusive with the matching `*err`.
A bare `color=` is a literal color; `aes(color="col")` → one series
per level (palette= maps levels to colors), and on a categorical axis
the series dodge within each band. `width=0.8` / `gap=0.1` are the same
band fractions as bar's, so a dodged errorbar lands on the same slot
centers as `c.add_bar(..., position="dodge")` with matching values.