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

Skip to content
23 changes: 20 additions & 3 deletions lib/matplotlib/tests/test_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,11 +464,28 @@ 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(2023, 11, 1+delta) for delta in range(threshold)]
)
y_dates = np.array(
[datetime.datetime(2023, 12, 1+delta) for delta in range(threshold)]
)
x_ranges = np.array(range(threshold))
y_ranges = np.array(range(threshold))
x_ranges = np.array(range(threshold))
y_ranges = np.array(range(threshold))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
x_ranges = np.array(range(threshold))
y_ranges = np.array(range(threshold))

These two lines can be removed as they're duplicates of the two lines above.

Copy link
Author

@Elllllllvin Elllllllvin Jan 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your reply, I have just removed two extra lines , but the auto-checks seems failed.. it is about Pull Request Labeler / labeler (pull_request_target) , I have tried several times but can't find reasons


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)

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