Skip to content

Commit

Permalink
Test bivariate normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
mwaskom committed Feb 1, 2021
1 parent d6f82ad commit c56b0c4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions seaborn/tests/test_distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit c56b0c4

Please sign in to comment.