@@ -792,17 +792,18 @@ def relplot(
792
792
793
793
# Add the grid semantics onto the plotter
794
794
grid_variables = dict (
795
- x = x , y = y , row = row , col = col ,
796
- hue = hue , size = size , style = style ,
795
+ x = x , y = y , row = row , col = col , hue = hue , size = size , style = style ,
797
796
)
798
797
if kind == "line" :
799
- grid_variables [ " units" ] = units
798
+ grid_variables . update ( units = units , weights = weights )
800
799
p .assign_variables (data , grid_variables )
801
800
802
801
# Define the named variables for plotting on each facet
803
802
# Rename the variables with a leading underscore to avoid
804
803
# collisions with faceting variable names
805
804
plot_variables = {v : f"_{ v } " for v in variables }
805
+ if "weight" in plot_variables :
806
+ plot_variables ["weights" ] = plot_variables .pop ("weight" )
806
807
plot_kws .update (plot_variables )
807
808
808
809
# Pass the row/col variables to FacetGrid with their original
@@ -930,6 +931,10 @@ def relplot(
930
931
Grouping variable that will produce elements with different styles.
931
932
Can have a numeric dtype but will always be treated as categorical.
932
933
{params.rel.units}
934
+ weights : vector or key in `data`
935
+ Data values or column used to compute weighted estimation.
936
+ Note that use of weights currently limits the choice of statistics
937
+ to a 'mean' estimator and 'ci' errorbar.
933
938
{params.facets.rowcol}
934
939
{params.facets.col_wrap}
935
940
row_order, col_order : lists of strings
0 commit comments