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 test_pcolormesh in test_datetime.py#27433

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

Open
nidaa-7 wants to merge5 commits intomatplotlib:main
base:main
Choose a base branch
Loading
fromnidaa-7:test-pcolormesh
Open
Show file tree
Hide file tree
Changes from1 commit
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
NextNext commit
added a test for fill in test_datetime.py
  • Loading branch information
@nidaa-7
nidaa-7 committedNov 29, 2023
commit40e8132e54c93ae87d5176dbb51e24c49ffb03e2
3 changes: 3 additions & 0 deletions.gitignore
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -114,3 +114,6 @@ lib/matplotlib/backends/web_backend/node_modules/
lib/matplotlib/backends/web_backend/package-lock.json

LICENSE/LICENSE_QHULL

# My virtual environment #
/venv/
30 changes: 27 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,35 @@ 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")

# Generate datetime for x-axis
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)

# Generate datetime for y-axis
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 # Random y-values between -2 and 3

# Plot filled polygons on each subplot
ax1.fill(x_dates, y_values)
ax2.fill(x_values, y_dates)
ax3.fill(x_values, y_values)
ax4.fill(x_dates, y_dates)

plt.savefig("test_fill_output.png")

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

[8]ページ先頭

©2009-2025 Movatter.jp