plotlet v0.6.2

pt.facet

Coordinates & layout

Minimal call

import math
raw = pt.load_dataset("penguins")
keep = [i for i in range(len(raw["species"]))
        if not math.isnan(raw["bill_length_mm"][i])
        and not math.isnan(raw["bill_depth_mm"][i])]
df = {k: [raw[k][i] for i in keep]
      for k in ("species", "bill_length_mm", "bill_depth_mm")}

c = pt.facet(df, by="species", col_wrap=3,
             data_width=150, data_height=130)
c.add_scatter(aes(x="bill_length_mm", y="bill_depth_mm"),
              size=2, alpha=0.7)

Docstring

Build a FacetGrid bound to `data`. `by=` wraps one variable's
    panels into a near-square grid (`col_wrap=` fixes the column count);
    `row=` / `col=` lay a two-factor grid, one factor per grid axis.
    Forwarded `chart_opts` (e.g. `data_width`, `xlabel`, `theme`) apply
    to every panel; the per-panel title defaults to the group label.