Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Add scatter test for datetime units#26882
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
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
74f562d
e5790ba
99648b0
9c85d6a
9a3c608
b46f6d1
b16472c
7388108
7c6eeef
93a7b2e
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 |
---|---|---|
@@ -279,9 +279,45 @@ def test_quiverkey(self): | ||
@pytest.mark.xfail(reason="Test for scatter not written yet") | ||
@mpl.style.context("default") | ||
def test_scatter(self): | ||
mpl.rcParams["date.converter"] = 'concise' | ||
base = datetime.datetime(2005, 2, 1) | ||
dates = [base + datetime.timedelta(hours=(2 * i)) for i in range(732)] | ||
QuLogic marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
N = len(dates) | ||
np.random.seed(19680801) | ||
y = np.cumsum(np.random.randn(N)) | ||
fig, axs = plt.subplots(3, 1, layout='constrained', figsize=(6, 6)) | ||
lims = [(np.datetime64('2005-02'), np.datetime64('2005-04')), | ||
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. It doesn't look like lims is used | ||
(np.datetime64('2005-02-03'), np.datetime64('2005-02-15')), | ||
(np.datetime64('2005-02-03 11:00'), np.datetime64('2005-02-04 13:20'))] | ||
axs[0].set_title('Axes.scatter used with datetime on x axis') | ||
seohyeonlee2020 marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
for elem in axs: | ||
print (elem) | ||
#datetime on x axis | ||
axs[0].scatter(dates, y) | ||
#axs[0].set_xlim(lims[nn]) | ||
# rotate_labels... | ||
for label in axs[0].get_xticklabels(): | ||
label.set_rotation(40) | ||
label.set_horizontalalignment('right') | ||
#datetime on y axis | ||
axs[1].set_title('Axes.scatter used with datetime on y axis') | ||
axs[1].scatter(y, dates) | ||
for label in axs[1].get_xticklabels(): | ||
label.set_rotation(40) | ||
label.set_horizontalalignment('right') | ||
#datetime on both x, y axes | ||
axs[2].set_title('Axes.scatter used with datetime on both axes') | ||
axs[2].scatter(dates, dates) | ||
for label in axs[2].get_xticklabels(): | ||
label.set_rotation(40) | ||
label.set_horizontalalignment('right') | ||
@pytest.mark.xfail(reason="Test for semilogx not written yet") | ||
@mpl.style.context("default") | ||
def test_semilogx(self): | ||