diff --git a/seaborn/distributions.py b/seaborn/distributions.py index f8ec166cf4..f91b93e59e 100644 --- a/seaborn/distributions.py +++ b/seaborn/distributions.py @@ -400,10 +400,12 @@ def plot_univariate_histogram( _check_argument("element", ["bars", "step", "poly"], element) auto_bins_with_weights = ( - "weights" in self.variables - and estimate_kws["bins"] == "auto" - and estimate_kws["binwidth"] is None - and not estimate_kws["discrete"] + isinstance(estimate_kws["bins"], str) and ( + "weights" in self.variables + and estimate_kws["bins"] == "auto" + and estimate_kws["binwidth"] is None + and not estimate_kws["discrete"] + ) ) if auto_bins_with_weights: msg = (