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

Add test_fill in test_datetime.py#27401

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 4 commits intomatplotlib:mainfromnidaa-7:test_fill
Dec 2, 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
27 changes: 24 additions & 3 deletionslib/matplotlib/tests/test_datetime.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -266,11 +266,32 @@ def test_eventplot(self):
fig, ax = plt.subplots()
ax.eventplot(...)

@pytest.mark.xfail(reason="Test for fill not written yet")
@mpl.style.context("default")
def test_fill(self):
fig, ax = plt.subplots()
ax.fill(...)
mpl.rcParams["date.converter"] = "concise"
fig, (ax1, ax2, ax3, ax4) = plt.subplots(4, 1, layout="constrained")

np.random.seed(19680801)

x_base_date = datetime.datetime(2023, 1, 1)
x_dates = [x_base_date]
for _ in range(1, 5):
x_base_date += datetime.timedelta(days=np.random.randint(1, 5))
x_dates.append(x_base_date)

y_base_date = datetime.datetime(2023, 1, 1)
y_dates = [y_base_date]
for _ in range(1, 5):
y_base_date += datetime.timedelta(days=np.random.randint(1, 5))
y_dates.append(y_base_date)

x_values = np.random.rand(5) * 5
y_values = np.random.rand(5) * 5 - 2

ax1.fill(x_dates, y_values)
ax2.fill(x_values, y_dates)
ax3.fill(x_values, y_values)
ax4.fill(x_dates, y_dates)

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

[8]ページ先頭

©2009-2025 Movatter.jp