Repository: mwaskom/seaborn

Issue:
bivariate displot with kind="hist" ignores common_norm=False if hue is not assigned
Somehow similar to #2377, but for `kind='hist'` and with `common_norm=False` being ignored.

If I understand it well, passing `common_norm=False` to `sns.distplot` should produce plots with independent "z" scale. While this is the behaviour for kde plots, it seems to be ignored for bivariate histograms unless hue is also specified.

Test case:
```python
x, y = np.random.randn(2, 200)
z = [0] * 150 + [1] * 50
sns.displot(x=x, y=y, col=z, kind="hist", cbar=True, common_norm=False)
sns.displot(x=x, y=y, col=z, hue=z, kind="hist", cbar=True, common_norm=False)
```

Running seaborn version 0.11.1
(I tried to look for other (open or closed) related issues, hope not duplicating them)

Discussion:
codecov[bot]: # [Codecov](https://codecov.io/gh/mwaskom/seaborn/pull/2468?src=pr&el=h1) Report
> Merging [#2468](https://codecov.io/gh/mwaskom/seaborn/pull/2468?src=pr&el=desc) (add4835) into [master](https://codecov.io/gh/mwaskom/seaborn/commit/beb7f822895375143de396659cb562465ade25d7?el=desc) (beb7f82) will **decrease** coverage by `0.42%`.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/mwaskom/seaborn/pull/2468/graphs/tree.svg?width=650&height=150&src=pr&token=SLuzHnA9Bl)](https://codecov.io/gh/mwaskom/seaborn/pull/2468?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master    #2468      +/-   ##
==========================================
- Coverage   97.44%   97.02%   -0.43%     
==========================================
  Files          17       17              
  Lines        6311     6280      -31     
==========================================
- Hits         6150     6093      -57     
- Misses        161      187      +26     
```


| [Impacted Files](https://codecov.io/gh/mwaskom/seaborn/pull/2468?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [seaborn/distributions.py](https://codecov.io/gh/mwaskom/seaborn/pull/2468/diff?src=pr&el=tree#diff-c2VhYm9ybi9kaXN0cmlidXRpb25zLnB5) | `95.98% <100.00%> (-0.35%)` | :arrow_down: |
| [seaborn/\_docstrings.py](https://codecov.io/gh/mwaskom/seaborn/pull/2468/diff?src=pr&el=tree#diff-c2VhYm9ybi9fZG9jc3RyaW5ncy5weQ==) | `97.05% <0.00%> (-2.95%)` | :arrow_down: |
| [seaborn/\_statistics.py](https://codecov.io/gh/mwaskom/seaborn/pull/2468/diff?src=pr&el=tree#diff-c2VhYm9ybi9fc3RhdGlzdGljcy5weQ==) | `98.43% <0.00%> (-1.57%)` | :arrow_down: |
| [seaborn/regression.py](https://codecov.io/gh/mwaskom/seaborn/pull/2468/diff?src=pr&el=tree#diff-c2VhYm9ybi9yZWdyZXNzaW9uLnB5) | `96.51% <0.00%> (-1.28%)` | :arrow_down: |
| [seaborn/matrix.py](https://codecov.io/gh/mwaskom/seaborn/pull/2468/diff?src=pr&el=tree#diff-c2VhYm9ybi9tYXRyaXgucHk=) | `94.94% <0.00%> (-0.92%)` | :arrow_down: |
| [seaborn/categorical.py](https://codecov.io/gh/mwaskom/seaborn/pull/2468/diff?src=pr&el=tree#diff-c2VhYm9ybi9jYXRlZ29yaWNhbC5weQ==) | `98.01% <0.00%> (-0.53%)` | :arrow_down: |
| [seaborn/utils.py](https://codecov.io/gh/mwaskom/seaborn/pull/2468/diff?src=pr&el=tree#diff-c2VhYm9ybi91dGlscy5weQ==) | `94.21% <0.00%> (-0.35%)` | :arrow_down: |
| [seaborn/\_core.py](https://codecov.io/gh/mwaskom/seaborn/pull/2468/diff?src=pr&el=tree#diff-c2VhYm9ybi9fY29yZS5weQ==) | `98.47% <0.00%> (-0.15%)` | :arrow_down: |
| [seaborn/axisgrid.py](https://codecov.io/gh/mwaskom/seaborn/pull/2468/diff?src=pr&el=tree#diff-c2VhYm9ybi9heGlzZ3JpZC5weQ==) | `95.57% <0.00%> (-0.05%)` | :arrow_down: |
| ... and [2 more](https://codecov.io/gh/mwaskom/seaborn/pull/2468/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/mwaskom/seaborn/pull/2468?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/mwaskom/seaborn/pull/2468?src=pr&el=footer). Last update [beb7f82...add4835](https://codecov.io/gh/mwaskom/seaborn/pull/2468?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

mwaskom: Perfect! Thanks!

Patch:
diff --git a/seaborn/distributions.py b/seaborn/distributions.py
index 0b07d687..47f59cbf 100644
--- a/seaborn/distributions.py
+++ b/seaborn/distributions.py
@@ -737,7 +737,7 @@ class _DistributionPlotter(VectorPlotter):
             )
             full_heights.append(sub_heights)
 
-        common_color_norm = "hue" not in self.variables or common_norm
+        common_color_norm = not set(self.variables) - {"x", "y"} or common_norm
 
         if pthresh is not None and common_color_norm:
             thresh = self._quantile_to_level(full_heights, pthresh)


Test patch:
diff --git a/seaborn/tests/test_distributions.py b/seaborn/tests/test_distributions.py
index 4ab3dfd9..f78e0669 100644
--- a/seaborn/tests/test_distributions.py
+++ b/seaborn/tests/test_distributions.py
@@ -2245,6 +2245,21 @@ class TestDisPlot:
         l2 = sum(bool(c.get_segments()) for c in g.axes.flat[1].collections)
         assert l1 == l2
 
+    def test_bivariate_hist_norm(self, rng):
+
+        x, y = rng.normal(0, 1, (2, 100))
+        z = [0] * 80 + [1] * 20
+
+        g = displot(x=x, y=y, col=z, kind="hist")
+        clim1 = g.axes.flat[0].collections[0].get_clim()
+        clim2 = g.axes.flat[1].collections[0].get_clim()
+        assert clim1 == clim2
+
+        g = displot(x=x, y=y, col=z, kind="hist", common_norm=False)
+        clim1 = g.axes.flat[0].collections[0].get_clim()
+        clim2 = g.axes.flat[1].collections[0].get_clim()
+        assert clim1[1] > clim2[1]
+
 
 def integrate(y, x):
     """"Simple numerical integration for testing KDE code."""