Skip to content

Commit

Permalink
Add test for specified width and fix two minor doc issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mwaskom committed Oct 30, 2022
1 parent 9523769 commit 954c8bb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 5 additions & 1 deletion doc/_docstrings/objects.Norm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
"cell_type": "code",
"execution_count": null,
"id": "0bfee8b6-1e3e-499d-96ae-735a5c230b32",
"metadata": {},
"metadata": {
"tags": [
"hide"
]
},
"outputs": [],
"source": [
"import seaborn.objects as so\n",
Expand Down
4 changes: 2 additions & 2 deletions seaborn/_core/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,8 @@ def scale(self, **scales: Scale) -> Plot:
- A list of values, implying a :class:`Nominal` scale (e.g. `["b", "r"]`)
For more explicit control, pass a scale spec object such as :class:`Continuous`
or :class:`Nominal`. Or use `None` to use an "identity" scale, which treats data
values as literally encoding visual properties.
or :class:`Nominal`. Or pass `None` to use an "identity" scale, which treats
data values as literally encoding visual properties.
Examples
--------
Expand Down
6 changes: 6 additions & 0 deletions tests/_core/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,12 @@ def test_two_grouping_variables(self, long_df):
long_df, m, data_vars, split_vars, split_cols, split_keys
)

def test_specified_width(self, long_df):

m = MockMark()
Plot(long_df, x="x", y="y").add(m, width="z").plot()
assert_array_almost_equal(m.passed_data[0]["width"], long_df["z"])

def test_facets_no_subgroups(self, long_df):

split_var = "col"
Expand Down

0 comments on commit 954c8bb

Please sign in to comment.