-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Fix clabel manual argument not accepting unit-typed coordinates
#31278
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -259,11 +259,17 @@ def test_bxp(self): | |
| ax.xaxis.set_major_formatter(mpl.dates.DateFormatter("%Y-%m-%d")) | ||
| ax.set_title('Box plot with datetime data') | ||
|
|
||
| @pytest.mark.xfail(reason="Test for clabel not written yet") | ||
| @mpl.style.context("default") | ||
| def test_clabel(self): | ||
| dates = [datetime.datetime(2023, 10, 1) + datetime.timedelta(days=i) | ||
| for i in range(10)] | ||
| x = np.arange(-10.0, 5.0, 0.5) | ||
| X, Y = np.meshgrid(x, dates) | ||
| Z = np.arange(X.size).reshape(X.shape) | ||
|
|
||
| fig, ax = plt.subplots() | ||
| ax.clabel(...) | ||
| CS = ax.contour(X, Y, Z) | ||
| ax.clabel(CS, manual=[(x[0], dates[0])]) | ||
|
Member
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. Can you test that the label is set to the expected value?
Contributor
Author
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. sure i can add an assertion on the label value, what would be the best way to check it, assert on the text string or the position?
Member
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. Both?
Contributor
Author
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. Done! |
||
|
|
||
| @mpl.style.context("default") | ||
| def test_contour(self): | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.