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

Skip to content
21 changes: 18 additions & 3 deletions lib/matplotlib/tests/test_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,11 +661,26 @@ def test_plot_date(self):
ax2.plot_date(x_dates, y_ranges)
ax3.plot_date(x_ranges, y_dates)

@pytest.mark.xfail(reason="Test for quiver not written yet")
@mpl.style.context("default")
def test_quiver(self):
fig, ax = plt.subplots()
ax.quiver(...)
threshold = 10
fig, (ax1, ax2, ax3) = plt.subplots(3, 1, layout="constrained")

x_dates = np.array(
[datetime.datetime(2024, 1, 1+delta) for delta in range(threshold)]
)
y_dates = np.array(
[datetime.datetime(2024, 2, 1+delta) for delta in range(threshold)]
)
x_ranges = np.array(range(threshold))
y_ranges = np.array(range(threshold))

U = np.sin(np.arange(len(x_dates)))
V = np.cos(np.arange(len(y_dates)))

ax1.quiver(x_dates, y_ranges, U, V, scale=20)
ax2.quiver(x_ranges, y_dates, U, V, scale=20)
ax3.quiver(x_dates, y_dates, U, V, scale=20)

@mpl.style.context("default")
def test_scatter(self):
Expand Down