| Title: | Statistical Data Visualization, the 'seaborn' Way |
|---|---|
| Description: | An 'R' port of the 'Python' 'seaborn' library. 'reaborn' mirrors the 'seaborn' public function API (identical function names, argument names, and defaults) and renders visually indistinguishable plots using 'ggplot2'. Because every 'reaborn' plot is a 'ggplot' object, it can be extended with the full 'ggplot2' grammar of graphics. |
| Authors: | Shawn Schwartz [aut, cre] (ORCID: <https://orcid.org/0000-0001-6444-8451>) |
| Maintainer: | Shawn Schwartz <[email protected]> |
| License: | BSD_3_clause + file LICENSE |
| Version: | 1.0.0 |
| Built: | 2026-07-01 11:12:28 UTC |
| Source: | https://github.com/shawntz/reaborn |
Port of seaborn.axes_style. Returns the resolved style definition.
axes_style(style = NULL, rc = NULL) set_style(style = NULL, rc = NULL)axes_style(style = NULL, rc = NULL) set_style(style = NULL, rc = NULL)
style |
One of |
rc |
Optional named list of overrides. |
A named list describing the style.
Port of seaborn.barplot. Bar heights are an aggregate (default mean) with a
bootstrap CI error bar. Returns a reaborn_plot.
barplot( data = NULL, x = NULL, y = NULL, hue = NULL, order = NULL, hue_order = NULL, estimator = "mean", errorbar = list("ci", 95), n_boot = 1000, seed = NULL, units = NULL, weights = NULL, orient = NULL, color = NULL, palette = NULL, saturation = 0.75, fill = TRUE, width = 0.8, dodge = "auto", gap = 0, capsize = 0, err_kws = NULL, legend = "auto", .facet_vars = NULL, ... )barplot( data = NULL, x = NULL, y = NULL, hue = NULL, order = NULL, hue_order = NULL, estimator = "mean", errorbar = list("ci", 95), n_boot = 1000, seed = NULL, units = NULL, weights = NULL, orient = NULL, color = NULL, palette = NULL, saturation = 0.75, fill = TRUE, width = 0.8, dodge = "auto", gap = 0, capsize = 0, err_kws = NULL, legend = "auto", .facet_vars = NULL, ... )
data |
A data frame. |
x, y
|
Variables; the categorical one defines the groups. |
hue |
Grouping variable for color (dodged). |
order, hue_order
|
Level orderings. |
estimator, errorbar, n_boot, seed
|
Aggregation + error settings. |
units, weights
|
Bootstrap structure / weights (units reserved). |
orient |
|
color, palette, saturation, fill
|
Color controls (saturation default 0.75). |
width, gap
|
Box width and gap between dodged boxes. |
dodge |
How to dodge bars by hue ( |
capsize |
Width of the error bar caps. |
err_kws |
Passed to the error bar geom. |
legend |
Legend control. |
.facet_vars |
Internal; facet columns forwarded by the figure-level dispatchers (catplot/displot/relplot). Not intended for direct use. |
... |
Passed to the bar geom. |
A reaborn_plot.
Port of seaborn.boxenplot (letter-value plot). Returns a reaborn_plot.
boxenplot( data = NULL, x = NULL, y = NULL, hue = NULL, order = NULL, hue_order = NULL, orient = NULL, color = NULL, palette = NULL, saturation = 0.75, fill = TRUE, width = 0.8, gap = 0, linewidth = NULL, linecolor = NULL, width_method = "exponential", k_depth = "tukey", outlier_prop = 0.007, trust_alpha = 0.05, showfliers = TRUE, legend = "auto", .facet_vars = NULL, ... )boxenplot( data = NULL, x = NULL, y = NULL, hue = NULL, order = NULL, hue_order = NULL, orient = NULL, color = NULL, palette = NULL, saturation = 0.75, fill = TRUE, width = 0.8, gap = 0, linewidth = NULL, linecolor = NULL, width_method = "exponential", k_depth = "tukey", outlier_prop = 0.007, trust_alpha = 0.05, showfliers = TRUE, legend = "auto", .facet_vars = NULL, ... )
data |
A data frame. |
x, y
|
Variables; the categorical one defines the groups. |
hue |
Grouping variable for color (dodged). |
order, hue_order
|
Level orderings. |
orient |
|
color, palette, saturation, fill
|
Color controls (saturation default 0.75). |
width, gap
|
Box width and gap between dodged boxes. |
linewidth |
Box outline width. |
linecolor |
Box outline color. |
width_method |
|
k_depth |
|
outlier_prop, trust_alpha
|
Tail-rule parameters. |
showfliers |
Draw outlier points. |
legend |
Legend control. |
.facet_vars |
Internal; facet columns forwarded by the figure-level dispatchers (catplot/displot/relplot). Not intended for direct use. |
... |
Passed to ggplot2::geom_boxplot. |
A reaborn_plot.
Port of seaborn.boxplot. Returns a reaborn_plot.
boxplot( data = NULL, x = NULL, y = NULL, hue = NULL, order = NULL, hue_order = NULL, orient = NULL, color = NULL, palette = NULL, saturation = 0.75, fill = TRUE, dodge = "auto", width = 0.8, gap = 0, whis = 1.5, linecolor = "auto", linewidth = NULL, fliersize = NULL, legend = "auto", .facet_vars = NULL, ... )boxplot( data = NULL, x = NULL, y = NULL, hue = NULL, order = NULL, hue_order = NULL, orient = NULL, color = NULL, palette = NULL, saturation = 0.75, fill = TRUE, dodge = "auto", width = 0.8, gap = 0, whis = 1.5, linecolor = "auto", linewidth = NULL, fliersize = NULL, legend = "auto", .facet_vars = NULL, ... )
data |
A data frame. |
x, y
|
Variables; the categorical one defines the groups. |
hue |
Grouping variable for color (dodged). |
order, hue_order
|
Level orderings. |
orient |
|
color, palette, saturation, fill
|
Color controls (saturation default 0.75). |
dodge |
How to dodge boxes by hue ( |
width, gap
|
Box width and gap between dodged boxes. |
whis |
Whisker length in IQR units (default 1.5). |
linecolor, linewidth, fliersize
|
Line and outlier styling. |
legend |
Legend control. |
.facet_vars |
Internal; facet columns forwarded by the figure-level dispatchers (catplot/displot/relplot). Not intended for direct use. |
... |
Passed to ggplot2::geom_boxplot. |
A reaborn_plot.
Port of seaborn.catplot. Dispatches to stripplot (kind = "strip"),
boxplot, barplot, pointplot, or countplot and adds row/col faceting.
Returns a faceted reaborn_plot.
catplot( data = NULL, x = NULL, y = NULL, hue = NULL, row = NULL, col = NULL, kind = "strip", estimator = "mean", errorbar = list("ci", 95), n_boot = 1000, seed = NULL, units = NULL, weights = NULL, order = NULL, hue_order = NULL, row_order = NULL, col_order = NULL, col_wrap = NULL, height = 5, aspect = 1, orient = NULL, color = NULL, palette = NULL, legend = "auto", facet_kws = NULL, ... )catplot( data = NULL, x = NULL, y = NULL, hue = NULL, row = NULL, col = NULL, kind = "strip", estimator = "mean", errorbar = list("ci", 95), n_boot = 1000, seed = NULL, units = NULL, weights = NULL, order = NULL, hue_order = NULL, row_order = NULL, col_order = NULL, col_wrap = NULL, height = 5, aspect = 1, orient = NULL, color = NULL, palette = NULL, legend = "auto", facet_kws = NULL, ... )
data |
A data frame. |
x, y
|
Variables; the categorical one defines the groups. |
hue |
Grouping variable for color (dodged). |
row, col, col_wrap, row_order, col_order
|
Faceting controls. |
kind |
One of |
estimator, errorbar, n_boot, seed
|
Aggregation settings (bar/point). |
units |
Unit grouping for bootstrap (bar/point kinds). |
weights |
Observation weights (bar/point kinds). |
order, hue_order
|
Level orderings. |
height, aspect
|
Facet sizing (stored as attributes). |
orient |
|
color |
Single color override. |
palette |
Palette for the hue mapping. |
legend |
Legend control. |
facet_kws |
Reserved for compatibility. |
... |
Passed to the underlying plotter. |
A reaborn_plot.
Port of seaborn.clustermap. Reorders rows/columns by hierarchical
clustering and draws dendrograms alongside the heatmap. Returns a patchwork
composition.
clustermap( data, method = "average", metric = "euclidean", z_score = NULL, standard_scale = NULL, row_cluster = TRUE, col_cluster = TRUE, cmap = NULL, dendrogram_ratio = 0.2, ... )clustermap( data, method = "average", metric = "euclidean", z_score = NULL, standard_scale = NULL, row_cluster = TRUE, col_cluster = TRUE, cmap = NULL, dendrogram_ratio = 0.2, ... )
data |
A matrix or data frame. |
method |
Linkage method (default |
metric |
Distance metric (default |
z_score |
Normalize rows ( |
standard_scale |
Scale rows ( |
row_cluster, col_cluster
|
Whether to cluster rows / columns. |
cmap |
Colormap (default |
dendrogram_ratio |
Fraction of the figure used by the dendrograms. |
... |
Passed to heatmap. |
A reaborn_plot (patchwork).
Port of seaborn.color_palette. Possible palette values include the name
of a seaborn palette (deep, muted, bright, pastel, dark,
colorblind), a matplotlib colormap name, "husl"/"hls", a cubehelix
shorthand ("ch:..."), "light:<color>", "dark:<color>",
"blend:<c1>,<c2>", or a sequence of colors.
color_palette(palette = NULL, n_colors = NULL, desat = NULL, as_cmap = FALSE) hls_palette(n_colors = 6, h = 0.01, l = 0.6, s = 0.65, as_cmap = FALSE) husl_palette(n_colors = 6, h = 0.01, s = 0.9, l = 0.65, as_cmap = FALSE) dark_palette( color, n_colors = 6, reverse = FALSE, as_cmap = FALSE, input = "rgb" ) light_palette( color, n_colors = 6, reverse = FALSE, as_cmap = FALSE, input = "rgb" ) diverging_palette( h_neg, h_pos, s = 75, l = 50, sep = 1, n = 6, center = "light", as_cmap = FALSE ) blend_palette(colors, n_colors = 6, as_cmap = FALSE, input = "rgb") mpl_palette(name, n_colors = 6, as_cmap = FALSE) cubehelix_palette( n_colors = 6, start = 0, rot = 0.4, gamma = 1, hue = 0.8, light = 0.85, dark = 0.15, reverse = FALSE, as_cmap = FALSE )color_palette(palette = NULL, n_colors = NULL, desat = NULL, as_cmap = FALSE) hls_palette(n_colors = 6, h = 0.01, l = 0.6, s = 0.65, as_cmap = FALSE) husl_palette(n_colors = 6, h = 0.01, s = 0.9, l = 0.65, as_cmap = FALSE) dark_palette( color, n_colors = 6, reverse = FALSE, as_cmap = FALSE, input = "rgb" ) light_palette( color, n_colors = 6, reverse = FALSE, as_cmap = FALSE, input = "rgb" ) diverging_palette( h_neg, h_pos, s = 75, l = 50, sep = 1, n = 6, center = "light", as_cmap = FALSE ) blend_palette(colors, n_colors = 6, as_cmap = FALSE, input = "rgb") mpl_palette(name, n_colors = 6, as_cmap = FALSE) cubehelix_palette( n_colors = 6, start = 0, rot = 0.4, gamma = 1, hue = 0.8, light = 0.85, dark = 0.15, reverse = FALSE, as_cmap = FALSE )
palette |
|
n_colors |
Number of colors. If |
desat |
Proportion to desaturate each color by. |
as_cmap |
If |
h, l, s
|
Hue, lightness, saturation anchors in |
color |
Base color for the high end of a sequential palette. |
reverse |
Reverse the direction of the blend. |
input |
Color space of the input color: |
h_neg, h_pos
|
Anchor hues ( |
sep |
Size of the intermediate (center) region. |
n |
Number of colors (when not returning a cmap). |
center |
|
colors |
A sequence of colors to blend between. |
name |
Name of a matplotlib colormap. |
start, rot, gamma, hue, light, dark
|
Cubehelix parameters (see seaborn). |
A character vector of hex colors, or a reaborn_cmap.
Port of seaborn.countplot. Returns a reaborn_plot.
countplot( data = NULL, x = NULL, y = NULL, hue = NULL, order = NULL, hue_order = NULL, orient = NULL, color = NULL, palette = NULL, saturation = 0.75, fill = TRUE, stat = "count", width = 0.8, dodge = "auto", gap = 0, legend = "auto", .facet_vars = NULL, ... )countplot( data = NULL, x = NULL, y = NULL, hue = NULL, order = NULL, hue_order = NULL, orient = NULL, color = NULL, palette = NULL, saturation = 0.75, fill = TRUE, stat = "count", width = 0.8, dodge = "auto", gap = 0, legend = "auto", .facet_vars = NULL, ... )
data |
A data frame. |
x, y
|
Variables; the categorical one defines the groups. |
hue |
Grouping variable for color (dodged). |
order, hue_order
|
Level orderings. |
orient |
|
color, palette, saturation, fill
|
Color controls (saturation default 0.75). |
stat |
|
width, gap
|
Box width and gap between dodged boxes. |
dodge |
How to dodge bars by hue ( |
legend |
Legend control. |
.facet_vars |
Internal; facet columns forwarded by the figure-level dispatchers (catplot/displot/relplot). Not intended for direct use. |
... |
Passed to the bar geom. |
A reaborn_plot.
Port of seaborn.desaturate.
desaturate(color, prop)desaturate(color, prop)
color |
A matplotlib-compatible color. |
prop |
Proportion (in |
A hex color string.
Port of seaborn.despine. Returns a ggplot2 theme partial that removes the
requested plot borders and (for borderless styles) draws explicit axis lines
on the kept sides. Add it to a reaborn/ggplot plot: p + despine().
despine( fig = NULL, ax = NULL, top = TRUE, right = TRUE, left = FALSE, bottom = FALSE, offset = NULL, trim = FALSE )despine( fig = NULL, ax = NULL, top = TRUE, right = TRUE, left = FALSE, bottom = FALSE, offset = NULL, trim = FALSE )
fig, ax
|
Ignored (kept for signature compatibility with seaborn). |
top, right, left, bottom
|
Logical; whether to remove that spine. Defaults match seaborn: remove top and right, keep left and bottom. |
offset, trim
|
Not supported by ggplot2; accepted but ignored in v1 with a one-time message. Present for signature compatibility. |
A ggplot2 theme object to add to a plot.
Port of seaborn.displot. Draws histplot (kind = "hist"), kdeplot
(kind = "kde"), or ecdfplot (kind = "ecdf") onto a grid of facets.
Returns a faceted reaborn_plot.
displot( data = NULL, x = NULL, y = NULL, hue = NULL, row = NULL, col = NULL, weights = NULL, kind = "hist", rug = FALSE, rug_kws = NULL, palette = NULL, hue_order = NULL, hue_norm = NULL, color = NULL, col_wrap = NULL, row_order = NULL, col_order = NULL, legend = TRUE, height = 5, aspect = 1, facet_kws = NULL, ... )displot( data = NULL, x = NULL, y = NULL, hue = NULL, row = NULL, col = NULL, weights = NULL, kind = "hist", rug = FALSE, rug_kws = NULL, palette = NULL, hue_order = NULL, hue_norm = NULL, color = NULL, col_wrap = NULL, row_order = NULL, col_order = NULL, legend = TRUE, height = 5, aspect = 1, facet_kws = NULL, ... )
data |
A data frame. |
x, y
|
Column name/vector for the histogram variable (use |
hue |
Grouping variable for color. |
row, col, col_wrap, row_order, col_order
|
Faceting controls. |
weights |
Optional observation weights. |
kind |
|
rug |
Add a marginal rug. |
rug_kws |
Arguments forwarded to the rug layer when |
palette, hue_order, hue_norm, color
|
Color controls. |
legend |
Show the legend. |
height, aspect
|
Facet size controls (stored as attributes). |
facet_kws |
Reserved for compatibility. |
... |
Passed to the bar geom. |
A reaborn_plot.
Port of seaborn.dogplot (an easter egg). Prints an affirmation.
dogplot(...)dogplot(...)
... |
Ignored. |
Invisibly NULL.
Port of seaborn.ecdfplot. Returns a reaborn_plot.
ecdfplot( data = NULL, x = NULL, y = NULL, hue = NULL, weights = NULL, stat = "proportion", complementary = FALSE, palette = NULL, hue_order = NULL, hue_norm = NULL, legend = TRUE, .facet_vars = NULL, ... )ecdfplot( data = NULL, x = NULL, y = NULL, hue = NULL, weights = NULL, stat = "proportion", complementary = FALSE, palette = NULL, hue_order = NULL, hue_norm = NULL, legend = TRUE, .facet_vars = NULL, ... )
data |
A data frame. |
x, y
|
Column name/vector for the histogram variable (use |
hue |
Grouping variable for color. |
weights |
Optional observation weights. |
stat |
|
complementary |
Plot the complementary ECDF (1 - F). |
palette |
Palette for the hue mapping. |
hue_order |
Order of hue levels. |
hue_norm |
Normalization for a numeric hue. |
legend |
Show the legend. |
.facet_vars |
Internal; facet columns forwarded by the figure-level dispatchers (catplot/displot/relplot). Not intended for direct use. |
... |
Passed to the bar geom. |
A reaborn_plot.
Lightweight port of seaborn.FacetGrid. In reaborn, faceting is usually done
by adding + ggplot2::facet_wrap()/facet_grid() to a plot, or via the
figure-level functions (relplot, displot, catplot, lmplot). This
constructor returns a base plot you can map geoms onto.
FacetGrid( data, row = NULL, col = NULL, hue = NULL, col_wrap = NULL, height = 3, aspect = 1, palette = NULL )FacetGrid( data, row = NULL, col = NULL, hue = NULL, col_wrap = NULL, height = 3, aspect = 1, palette = NULL )
data |
A data frame. |
row, col, hue
|
Faceting / hue variables. |
col_wrap |
Wrap columns at this width. |
height, aspect
|
Facet sizing. |
palette |
Hue palette. |
A reaborn_plot.
Port of seaborn.heatmap. Returns a reaborn_plot.
heatmap( data, vmin = NULL, vmax = NULL, cmap = NULL, center = NULL, robust = FALSE, annot = NULL, fmt = ".2g", annot_kws = NULL, linewidths = 0, linecolor = "white", cbar = TRUE, square = FALSE, xticklabels = "auto", yticklabels = "auto", mask = NULL, ... )heatmap( data, vmin = NULL, vmax = NULL, cmap = NULL, center = NULL, robust = FALSE, annot = NULL, fmt = ".2g", annot_kws = NULL, linewidths = 0, linecolor = "white", cbar = TRUE, square = FALSE, xticklabels = "auto", yticklabels = "auto", mask = NULL, ... )
data |
A matrix or data frame of values. |
vmin, vmax
|
Color scale limits. |
cmap |
A colormap name (default |
center |
Value at which to center a diverging colormap. |
robust |
Use the 2nd/98th percentiles for the color limits. |
annot |
Annotate each cell with its value ( |
fmt |
Number format for annotations (default |
annot_kws |
Passed to the text geom. |
linewidths, linecolor
|
Cell border width and color. |
cbar |
Show the color bar. |
square |
Force square cells. |
xticklabels, yticklabels
|
Tick label control ( |
mask |
Logical matrix of cells to hide. |
... |
Reserved. |
A reaborn_plot.
Port of seaborn.histplot. Returns a reaborn_plot.
histplot( data = NULL, x = NULL, y = NULL, hue = NULL, weights = NULL, stat = "count", bins = "auto", binwidth = NULL, binrange = NULL, discrete = NULL, cumulative = FALSE, common_bins = TRUE, common_norm = TRUE, multiple = "layer", element = "bars", fill = TRUE, shrink = 1, kde = FALSE, kde_kws = NULL, palette = NULL, hue_order = NULL, hue_norm = NULL, color = NULL, legend = TRUE, .facet_vars = NULL, ... )histplot( data = NULL, x = NULL, y = NULL, hue = NULL, weights = NULL, stat = "count", bins = "auto", binwidth = NULL, binrange = NULL, discrete = NULL, cumulative = FALSE, common_bins = TRUE, common_norm = TRUE, multiple = "layer", element = "bars", fill = TRUE, shrink = 1, kde = FALSE, kde_kws = NULL, palette = NULL, hue_order = NULL, hue_norm = NULL, color = NULL, legend = TRUE, .facet_vars = NULL, ... )
data |
A data frame. |
x, y
|
Column name/vector for the histogram variable (use |
hue |
Grouping variable for color. |
weights |
Optional observation weights. |
stat |
One of |
bins, binwidth, binrange, discrete
|
Binning controls (see rb_hist_bins). |
cumulative |
Accumulate counts. |
common_bins, common_norm
|
Share bins/normalization across hue groups. |
multiple |
|
element |
|
fill |
Whether to fill the bars. |
shrink |
Shrink bar widths by this factor. |
kde |
Overlay a KDE curve. |
kde_kws |
Arguments for the KDE (e.g. |
palette, hue_order, hue_norm, color
|
Color controls. |
legend |
Show the legend. |
.facet_vars |
Internal; facet columns forwarded by the figure-level dispatchers (catplot/displot/relplot). Not intended for direct use. |
... |
Passed to the bar geom. |
A reaborn_plot.
Port of seaborn.jointplot. Returns a patchwork composition (printable and
saveable like any reaborn plot).
jointplot( data = NULL, x = NULL, y = NULL, hue = NULL, kind = "scatter", height = 6, ratio = 5, space = 0.2, color = NULL, palette = NULL, ... )jointplot( data = NULL, x = NULL, y = NULL, hue = NULL, kind = "scatter", height = 6, ratio = 5, space = 0.2, color = NULL, palette = NULL, ... )
data |
A data frame. |
x, y
|
Variables. |
hue |
Grouping variable for color. |
kind |
|
height |
Figure size in inches (stored as an attribute). |
ratio |
Joint-axes-to-marginal size ratio. |
space |
Spacing between joint and marginal axes. |
color, palette
|
Color controls. |
... |
Passed to the joint plotting function. |
A reaborn_plot (patchwork).
Port of seaborn.kdeplot. The KDE matches scipy.stats.gaussian_kde exactly.
Returns a reaborn_plot.
kdeplot( data = NULL, x = NULL, y = NULL, hue = NULL, weights = NULL, palette = NULL, hue_order = NULL, hue_norm = NULL, color = NULL, fill = NULL, multiple = "layer", common_norm = TRUE, common_grid = FALSE, cumulative = FALSE, bw_method = "scott", bw_adjust = 1, log_scale = NULL, levels = 10, thresh = 0.05, gridsize = 200, cut = 3, clip = NULL, legend = TRUE, .facet_vars = NULL, ... )kdeplot( data = NULL, x = NULL, y = NULL, hue = NULL, weights = NULL, palette = NULL, hue_order = NULL, hue_norm = NULL, color = NULL, fill = NULL, multiple = "layer", common_norm = TRUE, common_grid = FALSE, cumulative = FALSE, bw_method = "scott", bw_adjust = 1, log_scale = NULL, levels = 10, thresh = 0.05, gridsize = 200, cut = 3, clip = NULL, legend = TRUE, .facet_vars = NULL, ... )
data |
A data frame. |
x, y
|
Column name/vector for the histogram variable (use |
hue |
Grouping variable for color. |
weights |
Optional observation weights. |
palette, hue_order, hue_norm, color
|
Color controls. |
fill |
Fill under the density curve (default |
multiple |
|
common_norm, common_grid
|
Share normalization / evaluation grid across hue groups. |
cumulative |
Plot the cumulative distribution. |
bw_method, bw_adjust
|
Bandwidth controls (scipy-compatible). |
log_scale |
Reserved for compatibility. |
levels, thresh
|
Bivariate contour levels and density threshold. |
gridsize, cut, clip
|
KDE grid controls. |
legend |
Show the legend. |
.facet_vars |
Internal; facet columns forwarded by the figure-level dispatchers (catplot/displot/relplot). Not intended for direct use. |
... |
Passed to the bar geom. |
A reaborn_plot.
Port of seaborn.lineplot. When the data has repeated observations per x
value, they are aggregated (default: mean) and an error band (default: 95%
bootstrap CI) is drawn. Returns a reaborn_plot.
lineplot( data = NULL, x = NULL, y = NULL, hue = NULL, size = NULL, style = NULL, units = NULL, weights = NULL, palette = NULL, hue_order = NULL, hue_norm = NULL, sizes = NULL, size_order = NULL, size_norm = NULL, dashes = TRUE, markers = NULL, style_order = NULL, estimator = "mean", errorbar = list("ci", 95), n_boot = 1000, seed = NULL, orient = "x", sort = TRUE, err_style = "band", err_kws = NULL, legend = "auto", .facet_vars = NULL, ... )lineplot( data = NULL, x = NULL, y = NULL, hue = NULL, size = NULL, style = NULL, units = NULL, weights = NULL, palette = NULL, hue_order = NULL, hue_norm = NULL, sizes = NULL, size_order = NULL, size_norm = NULL, dashes = TRUE, markers = NULL, style_order = NULL, estimator = "mean", errorbar = list("ci", 95), n_boot = 1000, seed = NULL, orient = "x", sort = TRUE, err_style = "band", err_kws = NULL, legend = "auto", .facet_vars = NULL, ... )
data |
A data frame. |
x, y
|
Column names (strings) or vectors giving the axes. |
hue, size, style
|
Column names/vectors for color, size, and marker-style semantics. |
units, weights
|
Column names/vectors for the unit grouping and weights. |
palette, hue_order, hue_norm
|
Control the color mapping. |
sizes, size_order, size_norm
|
Control the size mapping. |
dashes, markers
|
Style mapping controls. |
style_order |
Order of style levels. |
estimator |
Aggregation function name or callable (default |
errorbar |
Error representation: a method name or |
n_boot, seed
|
Bootstrap settings for |
orient, sort, err_style, err_kws
|
See seaborn. |
legend |
|
.facet_vars |
Internal; facet columns forwarded by the figure-level dispatchers (catplot/displot/relplot). Not intended for direct use. |
... |
Passed to ggplot2::geom_line. |
A reaborn_plot.
Port of seaborn.lmplot. Draws regplot across a grid of facets and/or hue
groups. Returns a reaborn_plot.
lmplot( data = NULL, x = NULL, y = NULL, hue = NULL, col = NULL, row = NULL, palette = NULL, col_wrap = NULL, height = 5, aspect = 1, order = 1, logistic = FALSE, lowess = FALSE, robust = FALSE, logx = FALSE, ci = 95, n_boot = 1000, seed = NULL, scatter = TRUE, fit_reg = TRUE, hue_order = NULL, row_order = NULL, col_order = NULL, legend = TRUE, facet_kws = NULL, ... )lmplot( data = NULL, x = NULL, y = NULL, hue = NULL, col = NULL, row = NULL, palette = NULL, col_wrap = NULL, height = 5, aspect = 1, order = 1, logistic = FALSE, lowess = FALSE, robust = FALSE, logx = FALSE, ci = 95, n_boot = 1000, seed = NULL, scatter = TRUE, fit_reg = TRUE, hue_order = NULL, row_order = NULL, col_order = NULL, legend = TRUE, facet_kws = NULL, ... )
data |
A data frame. |
x, y
|
Variables. |
hue, col, row
|
Semantic / faceting variables. |
palette |
Hue palette. |
col_wrap, row_order, col_order, hue_order
|
Ordering / wrapping. |
height, aspect
|
Facet sizing. |
order |
Polynomial order for the fit (default 1, linear). |
logistic, lowess, robust, logx
|
Alternative fits. |
ci |
Confidence-band width (default 95; |
n_boot, seed
|
Bootstrap settings. |
scatter, fit_reg
|
Whether to draw the scatter / the fit. |
legend, facet_kws
|
Legend / facet options. |
... |
Reserved. |
A reaborn_plot.
Port of seaborn.load_dataset. Bundled datasets (penguins, tips, iris,
flights) load offline; others download from the seaborn-data repo and cache.
load_dataset(name, cache = TRUE, data_home = NULL, ...) get_dataset_names()load_dataset(name, cache = TRUE, data_home = NULL, ...) get_dataset_names()
name |
Name of the dataset (the stem of a |
cache |
Whether to use the local cache (and bundled data). |
data_home |
Optional cache directory. |
... |
Reserved for compatibility. |
A data.frame, with categorical columns coerced to ordered factors matching seaborn.
For get_dataset_names, a character vector of available dataset names.
Port of seaborn.move_legend. Returns a theme partial controlling legend
position. Add it to a plot: p + move_legend("upper right").
move_legend(obj = NULL, loc = "best", ...)move_legend(obj = NULL, loc = "best", ...)
obj |
Ignored (signature compatibility). |
loc |
A seaborn/matplotlib location string (e.g. |
... |
Additional theme arguments (e.g. |
A ggplot2 theme object to add to a plot.
Port of seaborn.pairplot. Returns a patchwork matrix of scatter plots with
univariate distributions on the diagonal.
pairplot( data, vars = NULL, hue = NULL, kind = "scatter", diag_kind = "auto", palette = NULL, height = 2.5, aspect = 1, corner = FALSE, ... )pairplot( data, vars = NULL, hue = NULL, kind = "scatter", diag_kind = "auto", palette = NULL, height = 2.5, aspect = 1, corner = FALSE, ... )
data |
A data frame. |
vars |
Columns to include (default all numeric). |
hue |
Grouping variable for color. |
kind |
Off-diagonal kind: |
diag_kind |
Diagonal kind: |
palette, height, aspect, corner
|
Layout controls. |
... |
Reserved. |
A reaborn_plot (patchwork).
Port of seaborn.palplot. Returns a reaborn_plot.
palplot(pal, size = 1)palplot(pal, size = 1)
pal |
A sequence of colors (e.g. from color_palette). |
size |
Scaling factor for the swatch size. |
A reaborn_plot.
Port of seaborn.plotting_context. Returns a named list of resolved sizes.
plotting_context(context = NULL, font_scale = 1, rc = NULL) set_context(context = NULL, font_scale = 1, rc = NULL)plotting_context(context = NULL, font_scale = 1, rc = NULL) set_context(context = NULL, font_scale = 1, rc = NULL)
context |
One of |
font_scale |
Separate scaling factor applied to the font sizes only. |
rc |
Optional named list of overrides. |
A named list of context parameters.
Port of seaborn.pointplot. Returns a reaborn_plot.
pointplot( data = NULL, x = NULL, y = NULL, hue = NULL, order = NULL, hue_order = NULL, estimator = "mean", errorbar = list("ci", 95), n_boot = 1000, seed = NULL, units = NULL, weights = NULL, color = NULL, palette = NULL, markers = "o", linestyles = "-", dodge = FALSE, orient = NULL, capsize = 0, legend = "auto", err_kws = NULL, .facet_vars = NULL, ... )pointplot( data = NULL, x = NULL, y = NULL, hue = NULL, order = NULL, hue_order = NULL, estimator = "mean", errorbar = list("ci", 95), n_boot = 1000, seed = NULL, units = NULL, weights = NULL, color = NULL, palette = NULL, markers = "o", linestyles = "-", dodge = FALSE, orient = NULL, capsize = 0, legend = "auto", err_kws = NULL, .facet_vars = NULL, ... )
data |
A data frame. |
x, y
|
Variables; the categorical one defines the groups. |
hue |
Grouping variable for color (dodged). |
order, hue_order
|
Level orderings. |
estimator, errorbar, n_boot, seed
|
Aggregation + error settings. |
units, weights
|
Bootstrap structure / weights (units reserved). |
color |
Single color override. |
palette |
Palette for the hue mapping. |
markers, linestyles
|
Marker and line styling. |
dodge |
Dodge points by hue. |
orient |
|
capsize |
Width of the error bar caps. |
legend |
Legend control. |
err_kws |
Passed to the error bar geom. |
.facet_vars |
Internal; facet columns forwarded by the figure-level dispatchers (catplot/displot/relplot). Not intended for direct use. |
... |
Passed to the bar geom. |
A reaborn_plot.
True, False, and None are provided so that seaborn Python code pasted
into R (e.g. histplot(data = df, x = "a", kde = True)) runs unchanged.
They are exactly TRUE, FALSE, and NULL.
True False NoneTrue False None
True and False are length-one logicals; None is NULL.
These objects are exported constants, not functions. Referencing one yields
its stored value: True is the length-one logical vector TRUE, False is
the length-one logical vector FALSE, and None is NULL. They exist only
so that seaborn code containing Python's True, False, and None literals
evaluates in R unchanged.
Port of seaborn.regplot. The confidence band is a bootstrap interval, like
seaborn. Returns a reaborn_plot.
regplot( data = NULL, x = NULL, y = NULL, order = 1, logistic = FALSE, lowess = FALSE, robust = FALSE, logx = FALSE, ci = 95, n_boot = 1000, seed = NULL, scatter = TRUE, fit_reg = TRUE, color = NULL, marker = "o", scatter_kws = NULL, line_kws = NULL, truncate = TRUE, x_jitter = NULL, y_jitter = NULL, ... )regplot( data = NULL, x = NULL, y = NULL, order = 1, logistic = FALSE, lowess = FALSE, robust = FALSE, logx = FALSE, ci = 95, n_boot = 1000, seed = NULL, scatter = TRUE, fit_reg = TRUE, color = NULL, marker = "o", scatter_kws = NULL, line_kws = NULL, truncate = TRUE, x_jitter = NULL, y_jitter = NULL, ... )
data |
A data frame. |
x, y
|
Variables. |
order |
Polynomial order for the fit (default 1, linear). |
logistic, lowess, robust, logx
|
Alternative fits. |
ci |
Confidence-band width (default 95; |
n_boot, seed
|
Bootstrap settings. |
scatter, fit_reg
|
Whether to draw the scatter / the fit. |
color |
Color for points and line (default the first palette color). |
marker |
Marker (accepted for compatibility). |
scatter_kws, line_kws
|
Lists of extra args for the point / line layers. |
truncate |
Limit the regression line to the data range. |
x_jitter |
Uniform jitter added to x for display only. |
y_jitter |
Uniform jitter added to y for display only. |
... |
Reserved. |
A reaborn_plot.
Port of seaborn.relplot. Draws scatterplot (kind = "scatter") or
lineplot (kind = "line") onto a grid of facets defined by row/col.
Returns a reaborn_plot (a faceted ggplot) with the legend outside, like a
seaborn FacetGrid.
relplot( data = NULL, x = NULL, y = NULL, hue = NULL, size = NULL, style = NULL, units = NULL, weights = NULL, row = NULL, col = NULL, col_wrap = NULL, row_order = NULL, col_order = NULL, palette = NULL, hue_order = NULL, hue_norm = NULL, sizes = NULL, size_order = NULL, size_norm = NULL, markers = NULL, dashes = NULL, style_order = NULL, legend = "auto", kind = "scatter", height = 5, aspect = 1, facet_kws = NULL, ... )relplot( data = NULL, x = NULL, y = NULL, hue = NULL, size = NULL, style = NULL, units = NULL, weights = NULL, row = NULL, col = NULL, col_wrap = NULL, row_order = NULL, col_order = NULL, palette = NULL, hue_order = NULL, hue_norm = NULL, sizes = NULL, size_order = NULL, size_norm = NULL, markers = NULL, dashes = NULL, style_order = NULL, legend = "auto", kind = "scatter", height = 5, aspect = 1, facet_kws = NULL, ... )
data |
A data frame. |
x, y
|
Column names (strings) or vectors giving the axes. |
hue, size, style
|
Column names/vectors for color, size, and marker-style semantics. |
units, weights
|
Column names/vectors for the unit grouping and weights. |
row, col
|
Column names to facet by. |
col_wrap |
Wrap the column facets at this width. |
row_order, col_order
|
Facet orderings. |
palette, hue_order, hue_norm
|
Control the color mapping. |
sizes, size_order, size_norm
|
Control the size mapping. |
dashes, markers
|
Style mapping controls. |
style_order |
Order of style levels. |
legend |
|
kind |
|
height, aspect
|
Facet height (inches) and aspect ratio (stored as attributes used as defaults when saving). |
facet_kws |
Reserved for compatibility. |
... |
Passed to ggplot2::geom_line. |
A reaborn_plot.
Port of seaborn.reset_defaults / seaborn.reset_orig.
reset_defaults() reset_orig()reset_defaults() reset_orig()
Invisibly NULL.
Port of seaborn.residplot. Returns a reaborn_plot.
residplot( data = NULL, x = NULL, y = NULL, lowess = FALSE, order = 1, robust = FALSE, color = NULL, scatter_kws = NULL, line_kws = NULL, ... )residplot( data = NULL, x = NULL, y = NULL, lowess = FALSE, order = 1, robust = FALSE, color = NULL, scatter_kws = NULL, line_kws = NULL, ... )
data |
A data frame. |
x, y
|
Variables. |
lowess |
Add a lowess smooth of the residuals. |
order |
Polynomial order for the fit (default 1, linear). |
robust |
Fit a robust regression when computing residuals. |
color |
Color for points and line (default the first palette color). |
scatter_kws, line_kws
|
Lists of extra args for the point / line layers. |
... |
Reserved. |
A reaborn_plot.
Port of seaborn.rugplot. Draws small ticks at each observation along the
relevant axis. Returns a reaborn_plot (typically added to another plot, but
usable standalone).
rugplot( data = NULL, x = NULL, y = NULL, hue = NULL, height = 0.025, expand_margins = TRUE, palette = NULL, hue_order = NULL, hue_norm = NULL, legend = TRUE, ... )rugplot( data = NULL, x = NULL, y = NULL, hue = NULL, height = 0.025, expand_margins = TRUE, palette = NULL, hue_order = NULL, hue_norm = NULL, legend = TRUE, ... )
data |
A data frame. |
x, y
|
Column name/vector for the histogram variable (use |
hue |
Grouping variable for color. |
height |
Tick height as a fraction of the axis (default |
expand_margins |
Reserved for compatibility. |
palette |
Palette for the hue mapping. |
hue_order |
Order of hue levels. |
hue_norm |
Normalization for a numeric hue. |
legend |
Show the legend. |
... |
Passed to the bar geom. |
A reaborn_plot.
Port of seaborn.saturate.
saturate(color)saturate(color)
color |
A matplotlib-compatible color. |
A hex color string.
Port of seaborn.scatterplot. Returns a reaborn_plot (a ggplot), so it can
be extended with any ggplot2 component.
scatterplot( data = NULL, x = NULL, y = NULL, hue = NULL, size = NULL, style = NULL, palette = NULL, hue_order = NULL, hue_norm = NULL, sizes = NULL, size_order = NULL, size_norm = NULL, markers = TRUE, style_order = NULL, legend = "auto", ... )scatterplot( data = NULL, x = NULL, y = NULL, hue = NULL, size = NULL, style = NULL, palette = NULL, hue_order = NULL, hue_norm = NULL, sizes = NULL, size_order = NULL, size_norm = NULL, markers = TRUE, style_order = NULL, legend = "auto", ... )
data |
A data frame. |
x, y
|
Column names (strings) or vectors giving the axes. |
hue, size, style
|
Column names/vectors for color, size, and marker-style semantics. |
palette, hue_order, hue_norm
|
Control the color mapping. |
sizes, size_order, size_norm
|
Control the size mapping. |
markers, style_order
|
Control the style (marker) mapping. |
legend |
|
... |
Passed to ggplot2::geom_point. |
A reaborn_plot.
Port of seaborn.set_color_codes. Returns (invisibly) the mapping from the
single-letter codes b g r m y c k to the colors of the given seaborn
palette, so reaborn helpers can resolve them like seaborn does.
set_color_codes(palette = "deep")set_color_codes(palette = "deep")
palette |
One of |
Invisibly, the named character vector of code -> hex mappings.
Port of seaborn.set_hls_values.
set_hls_values(color, h = NULL, l = NULL, s = NULL)set_hls_values(color, h = NULL, l = NULL, s = NULL)
color |
A matplotlib-compatible color. |
h, l, s
|
New hue, lightness, saturation in |
A hex color string.
Port of seaborn.set_palette.
set_palette(palette, n_colors = NULL, desat = NULL, color_codes = FALSE)set_palette(palette, n_colors = NULL, desat = NULL, color_codes = FALSE)
palette |
A palette name or sequence (see color_palette). |
n_colors, desat, color_codes
|
See seaborn. |
Invisibly NULL.
Port of seaborn.set_theme (and its alias set). Sets the global look used
by subsequent reaborn (and ggplot2) plots.
set_theme( context = "notebook", style = "darkgrid", palette = "deep", font = "sans", font_scale = 1, color_codes = TRUE, rc = NULL ) set(...)set_theme( context = "notebook", style = "darkgrid", palette = "deep", font = "sans", font_scale = 1, color_codes = TRUE, rc = NULL ) set(...)
context, style, palette, font, font_scale, color_codes, rc
|
See seaborn. |
... |
Passed to set_theme. |
Invisibly, the applied ggplot2::theme.
sns. function aliasesFor copy-paste compatibility with Python, reaborn provides a sns.-prefixed
alias for every public plotting, palette, and theming function (R allows dots
in identifiers). So pasted seaborn code such as
sns.scatterplot(data = df, x = "a", y = "b", hue = "g") runs verbatim.
Each alias is identical to its unprefixed counterpart; see that function for
arguments and details.
Each sns.-prefixed object is the exact same function as its unprefixed
counterpart (sns.scatterplot <- scatterplot, and so on), so calling an
alias returns precisely what the counterpart returns. By category: the
plotting functions (e.g. sns.scatterplot(), sns.histplot(),
sns.heatmap(), sns.pairplot(), sns.FacetGrid(), sns.palplot()) return
a reaborn_plot object (a ggplot2/patchwork object that draws when printed),
except the easter-egg sns.dogplot(), which prints an affirmation and
returns NULL invisibly;
the palette constructors (e.g. sns.color_palette(), sns.husl_palette(),
sns.cubehelix_palette()) return a character vector of hex colors, or a
reaborn_cmap; the color helpers sns.desaturate(), sns.saturate(), and
sns.set_hls_values() return a hex color string; sns.axes_style() and
sns.plotting_context() return a named list of style/context parameters;
sns.despine() and sns.move_legend() return a ggplot2 theme object to add
to a plot; sns.load_dataset() returns a data frame and
sns.get_dataset_names() a character vector; and the theming setters
(sns.set_theme(), sns.set(), sns.set_style(), sns.set_context(),
sns.set_palette(), sns.set_color_codes(), sns.reset_defaults(),
sns.reset_orig()) are called for their side effect of changing global plot
defaults and return their value invisibly. See each unprefixed function's own
help page for the precise structure and meaning of its return value.
pen <- load_dataset("penguins") p <- sns.scatterplot(data = pen, x = "bill_length_mm", y = "bill_depth_mm", hue = "species")pen <- load_dataset("penguins") p <- sns.scatterplot(data = pen, x = "bill_length_mm", y = "bill_depth_mm", hue = "species")
Port of seaborn.stripplot. Returns a reaborn_plot.
stripplot( data = NULL, x = NULL, y = NULL, hue = NULL, order = NULL, hue_order = NULL, jitter = TRUE, dodge = FALSE, orient = NULL, color = NULL, palette = NULL, size = 5, edgecolor = "gray", linewidth = 0, legend = "auto", .facet_vars = NULL, ... )stripplot( data = NULL, x = NULL, y = NULL, hue = NULL, order = NULL, hue_order = NULL, jitter = TRUE, dodge = FALSE, orient = NULL, color = NULL, palette = NULL, size = 5, edgecolor = "gray", linewidth = 0, legend = "auto", .facet_vars = NULL, ... )
data |
A data frame. |
x, y
|
Variables; the categorical one defines the groups. |
hue |
Grouping variable for color (dodged). |
order, hue_order
|
Level orderings. |
jitter |
|
dodge |
Separate hue levels along the categorical axis. |
orient |
|
color |
Single color override. |
palette |
Palette for the hue mapping. |
size |
Marker size (seaborn default 5). |
edgecolor, linewidth
|
Marker edge styling. |
legend |
Legend control. |
.facet_vars |
Internal; facet columns forwarded by the figure-level dispatchers (catplot/displot/relplot). Not intended for direct use. |
... |
Passed to the point geom. |
A reaborn_plot.
Port of seaborn.swarmplot, using a beeswarm layout. Returns a reaborn_plot.
swarmplot( data = NULL, x = NULL, y = NULL, hue = NULL, order = NULL, hue_order = NULL, dodge = FALSE, orient = NULL, color = NULL, palette = NULL, size = 5, edgecolor = NULL, linewidth = 0, legend = "auto", .facet_vars = NULL, ... )swarmplot( data = NULL, x = NULL, y = NULL, hue = NULL, order = NULL, hue_order = NULL, dodge = FALSE, orient = NULL, color = NULL, palette = NULL, size = 5, edgecolor = NULL, linewidth = 0, legend = "auto", .facet_vars = NULL, ... )
data |
A data frame. |
x, y
|
Variables; the categorical one defines the groups. |
hue |
Grouping variable for color (dodged). |
order, hue_order
|
Level orderings. |
dodge |
Separate hue levels along the categorical axis. |
orient |
|
color |
Single color override. |
palette |
Palette for the hue mapping. |
size |
Marker size (seaborn default 5). |
edgecolor, linewidth
|
Marker edge styling. |
legend |
Legend control. |
.facet_vars |
Internal; facet columns forwarded by the figure-level dispatchers (catplot/displot/relplot). Not intended for direct use. |
... |
Passed to ggbeeswarm::geom_beeswarm. |
A reaborn_plot.
Build a ggplot2 theme replicating a seaborn style + context
theme_seaborn( style = "darkgrid", context = "notebook", font_scale = 1, font = "sans" )theme_seaborn( style = "darkgrid", context = "notebook", font_scale = 1, font = "sans" )
style |
A seaborn style name (see axes_style). |
context |
A seaborn context name (see plotting_context). |
font_scale |
Font scaling factor. |
font |
Base font family. |
A complete ggplot2::theme object.
Port of seaborn.violinplot. The kernel density matches
scipy.stats.gaussian_kde. Returns a reaborn_plot.
violinplot( data = NULL, x = NULL, y = NULL, hue = NULL, order = NULL, hue_order = NULL, orient = NULL, color = NULL, palette = NULL, saturation = 0.75, fill = TRUE, inner = "box", split = FALSE, width = 0.8, dodge = "auto", gap = 0, linewidth = NULL, linecolor = "auto", cut = 2, gridsize = 100, bw_method = "scott", bw_adjust = 1, density_norm = "area", common_norm = FALSE, legend = "auto", inner_kws = NULL, .facet_vars = NULL, ... )violinplot( data = NULL, x = NULL, y = NULL, hue = NULL, order = NULL, hue_order = NULL, orient = NULL, color = NULL, palette = NULL, saturation = 0.75, fill = TRUE, inner = "box", split = FALSE, width = 0.8, dodge = "auto", gap = 0, linewidth = NULL, linecolor = "auto", cut = 2, gridsize = 100, bw_method = "scott", bw_adjust = 1, density_norm = "area", common_norm = FALSE, legend = "auto", inner_kws = NULL, .facet_vars = NULL, ... )
data |
A data frame. |
x, y
|
Variables; the categorical one defines the groups. |
hue |
Grouping variable for color (dodged). |
order, hue_order
|
Level orderings. |
orient |
|
color, palette, saturation, fill
|
Color controls (saturation default 0.75). |
inner |
|
split |
Draw split violins for two hue levels. |
width, gap
|
Box width and gap between dodged boxes. |
dodge |
How to dodge violins by hue ( |
linewidth |
Outline width. |
linecolor |
Outline color ( |
cut, gridsize, bw_method, bw_adjust
|
KDE controls. |
density_norm |
|
common_norm |
Normalize densities across all groups together. |
legend |
Legend control. |
inner_kws |
Passed to the inner annotation geoms. |
.facet_vars |
Internal; facet columns forwarded by the figure-level dispatchers (catplot/displot/relplot). Not intended for direct use. |
... |
Passed to ggplot2::geom_boxplot. |
A reaborn_plot.