Qu

sns_box

Builtin index · Plotting

sns_box(df, groupcol, valuecol)

Input: df, groupcol, valuecol · Output: no output

What it is

One boxplot group per distinct value of column groupcol (string, first-seen order) in Table df, each group's values drawn from column valuecol (string) and labeled with the group's name.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
sns_box(df, groupcol, valuecol)
df string or Tablenot documented yet
groupcol string or Tablenot documented yet
valuecol string or Tablenot documented yet
no output—

Examples

From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.

df = table(x = randn(30, seed = 1), y = randn(30, seed = 2),
           grp = ["a","b","a","b","a","b","a","b","a","b",
                  "a","b","a","b","a","b","a","b","a","b",
                  "a","b","a","b","a","b","a","b","a","b"])
sns_scatter(df, "x", "y", "grp")
figure()
sns_box(df, "grp", "y")
figure()
sns_bar(df, "grp", "y")
print("rows: " + str(rows(df)))
output
rows: 30
0 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20 0.22 0.24 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 x=0, y=0.138 x=1, y=0.241

from plotting

How it works

sns_box(df, groupcol, valuecol) — one boxplot group per distinct groupcol value (first-seen order).

From the note above this builtin in the interpreter, where the reasoning was written down as it was built.