Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rugplot with datetime data #2458

Merged
merged 1 commit into from
Jan 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/releases/v0.12.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ v0.12.0 (Unreleased)

- |Fix| In :func:`lineplot, allowed the `dashes` keyword to set the style of a line without mapping a `style` variable (:pr:`2449`).

- |Fix| In :func:`rugplot`, fixed a bug that prevented the use of datetime data (:pr:`2458`).

- |Fix| |Enhancement| Improved integration with the matplotlib color cycle in most axes-level functions (:pr:`2449`).

- Made `scipy` an optional dependency and added `pip install seaborn[all]` as a method for ensuring the availability of compatible `scipy` and `statsmodels` libraries at install time. This has a few minor implications for existing code, which are explained in the Github pull request (:pr:`2398`).
Expand Down
2 changes: 1 addition & 1 deletion seaborn/distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,7 @@ def plot_univariate_ecdf(self, estimate_kws, legend, **plot_kws):

def plot_rug(self, height, expand_margins, legend, **kws):

for sub_vars, sub_data, in self.iter_data():
for sub_vars, sub_data, in self.iter_data(from_comp_data=True):

ax = self._get_axes(sub_vars)

Expand Down
6 changes: 6 additions & 0 deletions seaborn/tests/test_distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ def test_flat_vector(self, long_df):
rugplot(x=long_df["x"])
self.assert_rug_equal(*ax.collections)

def test_datetime_data(self, long_df):

ax = rugplot(data=long_df["t"])
vals = np.stack(ax.collections[0].get_segments())[:, 0, 0]
assert_array_equal(vals, mpl.dates.date2num(long_df["t"]))

def test_empty_data(self):

ax = rugplot(x=[])
Expand Down