diff --git a/seaborn/tests/test_distributions.py b/seaborn/tests/test_distributions.py index ebb86db4e8..a2f8628e0e 100644 --- a/seaborn/tests/test_distributions.py +++ b/seaborn/tests/test_distributions.py @@ -1816,6 +1816,17 @@ def test_mesh_unique_norm(self, long_df): density, (x_edges, y_edges) = sub_hist(sub_df["x"], sub_df["y"]) assert_array_equal(mesh_data.data, density.T.flat) + @pytest.mark.parametrize("stat", ["probability", "percent"]) + def test_mesh_normalization(self, long_df, stat): + + ax = histplot( + long_df, x="x", y="y", stat=stat, + ) + + mesh_data = ax.collections[0].get_array() + expected_sum = {"probability": 1, "percent": 100}[stat] + assert mesh_data.data.sum() == expected_sum + def test_mesh_colors(self, long_df): color = "r"