Qu

sns_scatter

Builtin index · Plotting

sns_scatter(df, xcol, ycol, [huecol])

Input: df, xcol, ycol, huecol · Output: no output

What it is

Seaborn-style scatter pulling columns from Table df: xcol, ycol (strings, column names) give the coordinates; optional huecol (string, column name) draws one series per distinct hue value (first-seen order) and turns the legend on.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
sns_scatter(df, xcol, ycol, [huecol])
df Table or stringSeaborn-style scatter pulling columns from Table df: xcol, ycol (strings, column names) give the coordinates.
xcol Table or stringSeaborn-style scatter pulling columns from Table df: xcol, ycol (strings, column names) give the coordinates.
ycol Table or stringSeaborn-style scatter pulling columns from Table df: xcol, ycol (strings, column names) give the coordinates.
huecol string, optionaloptional huecol (string, column name) draws one series per distinct hue value (first-seen order) and turns the legend on.
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

a table and drive the existing scatter/boxplot/bar machinery, auto-grouping by a categorical column where relevant. sns_scatter(df, xcol, ycol, [huecol]) — one scatter series per distinct huecol value (first-seen order) if given, else a single series.

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