plotlet v0.6.2

axline

Guides & annotation

Minimal call

import random
rng = random.Random(31)
obs = [i * 0.5 + rng.gauss(0, 0.6) for i in range(20)]
df = {"o": obs, "p": [v + rng.gauss(0, 0.5) for v in obs]}

c = pt.chart(df, aes(x="o", y="p"), xlabel="observed", ylabel="predicted")
c.add_scatter(size=2.5)
c.add_axline((0, 0), slope=1, linestyle="--")

Docstring

Reference-line / span artists — decorate the frame.

`axhline` / `axvline` / `axhspan` / `axvspan` ignore autoscaling and span
the full frame regardless of the data scale. `axline` is the arbitrary-
direction sibling (matplotlib `axline` / ggplot `geom_abline`):

  c.add_axline((0, 0), (1, 1))          # infinite line through two points
  c.add_axline((0, 0), slope=1)         # point + slope (linear scales only)

`hlines` / `vlines` are the bounded, data-coordinate counterparts that
participate in autoscaling and use the color cycle so a labeled call acts
like a series.