Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
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
27 changes: 24 additions & 3 deletions lib/matplotlib/tests/test_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -810,11 +810,32 @@ def test_triplot(self):
fig, ax = plt.subplots()
ax.triplot(...)

@pytest.mark.xfail(reason="Test for violin not written yet")
@pytest.mark.parametrize("orientation", ["vertical", "horizontal"])
@mpl.style.context("default")
def test_violin(self):
def test_violin(self, orientation):
fig, ax = plt.subplots()
ax.violin(...)
datetimes = [
datetime.datetime(2023, 2, 10),
datetime.datetime(2023, 5, 18),
datetime.datetime(2023, 6, 6)
]
ax.violin(
[
{
'coords': datetimes,
'vals': [0.1, 0.5, 0.2],
'mean': datetimes[1],
'median': datetimes[1],
'min': datetimes[0],
'max': datetimes[-1],
'quantiles': datetimes
}
],
orientation=orientation,
# TODO: It should be possible for positions to be datetimes too
# https://github.com/matplotlib/matplotlib/issues/30417
# positions=[datetime.datetime(2020, 1, 1)]
)

@pytest.mark.xfail(reason="Test for violinplot not written yet")
@mpl.style.context("default")
Expand Down
Loading