Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added smoke test for Axes.barbs in test_datetime.py#27331

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
QuLogic merged 3 commits intomatplotlib:mainfromElisaHeck:axes-barbs-smoke-test
Nov 30, 2023
Merged
Changes fromall 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
24 changes: 21 additions & 3 deletionslib/matplotlib/tests/test_datetime.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,11 +146,29 @@ def test_bar_label(self):
fig, ax = plt.subplots()
ax.bar_label(...)

@pytest.mark.xfail(reason="Test for barbs not written yet")
@mpl.style.context("default")
def test_barbs(self):
fig, ax = plt.subplots()
ax.barbs(...)
plt.rcParams["date.converter"] = 'concise'

start_date = datetime.datetime(2022, 2, 8, 22)
dates = [start_date + datetime.timedelta(hours=i) for i in range(12)]

numbers = np.sin(np.linspace(0, 2 * np.pi, 12))

u = np.ones(12) * 10
v = np.arange(0, 120, 10)

fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(12, 6))

axes[0].barbs(dates, numbers, u, v, length=7)
axes[0].set_title('Datetime vs. Numeric Data')
axes[0].set_xlabel('Datetime')
axes[0].set_ylabel('Numeric Data')

axes[1].barbs(numbers, dates, u, v, length=7)
axes[1].set_title('Numeric vs. Datetime Data')
axes[1].set_xlabel('Numeric Data')
axes[1].set_ylabel('Datetime')

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

[8]ページ先頭

©2009-2025 Movatter.jp