Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
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
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
40e8132
7de0d46
6322cc9
a53ffcc
6f4e568
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -450,11 +450,27 @@ def test_pcolorfast(self): | ||
fig, ax = plt.subplots() | ||
ax.pcolorfast(...) | ||
@mpl.style.context("default") | ||
def test_pcolormesh(self): | ||
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 + datetime.timedelta(days=i) for i in range(5)] | ||
y_base_date = datetime.datetime(2023, 1, 1) | ||
y_dates = [y_base_date + datetime.timedelta(days=i) for i in range(5)] | ||
x_timestamps = [date.timestamp() for date in x_dates] | ||
y_timestamps = [date.timestamp() for date in y_dates] | ||
Comment on lines +465 to +466 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I would avoid using the timestamp for the non-date data, as it is a number that looks like it should be interpreted as a data (and thus made me do a doubletake when I saw the image) Perhaps just do e.g. | ||
data = np.random.rand(len(x_dates), len(y_dates)) | ||
ax1.pcolormesh(x_dates, y_dates, data, cmap='viridis') | ||
ax2.pcolormesh(x_dates, y_timestamps, data, cmap='viridis') | ||
ax3.pcolormesh(x_timestamps, y_dates, data, cmap='viridis') | ||
ax4.pcolormesh(x_timestamps, y_timestamps, data, cmap='viridis') | ||
@mpl.style.context("default") | ||
def test_plot(self): | ||