| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Thank you for opening your first PR into Matplotlib! If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks. You can also join us on gitter for real-time discussion. For details on testing, writing docs, and our review process, please see the developer guide. We strive to be a welcoming and open project. Please follow our Code of Conduct. |
Sorry, something went wrong.
|
Hi @aman-coder03 thank you for your interest in contributing to Matplotlib! Please can you run the example from the issue with your branch, and post the image that it now produces. |
Sorry, something went wrong.
Sorry, something went wrong.
|
failing tests are unrelated to this fix test_webagg is a known flaky timeout issue and test_upsample_interpolation_stage is a subprocess resource warning... all other 9921 tests pass |
Sorry, something went wrong.
|
Thanks for posting the image. I agree that looks correct. Please can you modify this test so it covers the case you are fixing. matplotlib/lib/matplotlib/tests/test_datetime.py Lines 262 to 266 in 51a1ab6 |
Sorry, something went wrong.
|
@rcomer i have added the test now! |
Sorry, something went wrong.
|
Thanks for adding the test. Is there any way it could be simplified, but still fail without your change? |
Sorry, something went wrong.
|
yes @rcomer working on simplifying it, will push a commit shortly |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks @aman-coder03. This seems right to me.
Sorry, something went wrong.
| fig, ax = plt.subplots() | ||
| ax.clabel(...) | ||
| CS = ax.contour(X, Y, Z) | ||
| ax.clabel(CS, manual=[(x[0], dates[0])]) |
There was a problem hiding this comment.
Can you test that the label is set to the expected value?
Sorry, something went wrong.
There was a problem hiding this comment.
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?
Sorry, something went wrong.
There was a problem hiding this comment.
Both?
Sorry, something went wrong.
There was a problem hiding this comment.
Done!
Sorry, something went wrong.
…ing unit-typed coordinates
…278-on-v3.10.x Backport PR #31278 on branch v3.10.x (Fix `clabel` manual argument not accepting unit-typed coordinates)
| Back | FazBrowse Home | New Git URL |
PR summary
when unit typed coordinates(e.g datetime) are passed to the manual argument of clabel...they were passed directly to transform.transform() without unit conversion, causing a TypeError because the transform expects float64 but received Python objects
fixed by calling self.axes.convert_xunits(x) and self.axes.convert_yunits(y) in add_label_near() before applying the transform. This is the same pattern already used elsewhere in _base.py and is a no-op when nounit converter is registered, so non-unit axes are unaffected
AI Disclosure
PR checklist