sns_scatter
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.
| Code | Input | Output | Description |
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)))
rows: 30
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.