| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Thank you for opening your first PR into Matplotlib!
If you have not heard from us in a while, please feel free to ping @matplotlib/developers or anyone who has commented on the PR. 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.
| y = y / (self._boundaries[self._inside][-1] - | ||
| self._boundaries[self._inside][0]) | ||
|
|
||
| # original |
There was a problem hiding this comment.
Please do not keep the original code around. Because the code is in git and there are a number of UIs (inculding this website) for viewing the diffs it is much clearer to simply remove the old code and replace it with the new code. If we kept the full history of Matplotib in-line like this it would very quickly become impossible to read!
Sorry, something went wrong.
| cs = ax.contour([[2, 2], [2, 2]]) | ||
| assert len(record) == 1 | ||
| try: | ||
| fig.colorbar(cs, ax=ax) |
There was a problem hiding this comment.
Why is this in a try-except?
Sorry, something went wrong.
| # self._boundaries[self._inside][0]) | ||
|
|
||
| # change | ||
| if (self._boundaries[self._inside][-1] |
There was a problem hiding this comment.
does this need an else branch?
Sorry, something went wrong.
|
👋🏻 Hi @TianzeMYou - gentle ping that you have a pending review on this PR, are you still interested in working on it? If you need help, please let us know. Cheers! |
Sorry, something went wrong.
|
The issue has been solved through another fix. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
The original code for reproduction of this issue #23817 is
However, this seems to yield the following TypeError
TypeError: Input z must be 2D, not 1D
The same TypeError also occurs if we change
to
This TypeError is resulted from lib/matplotlib/contour.py, line 1526, in _initialize_x_y, which makes me think that rather than a colorbar problem, the root of this issue lies in how contour works. What is the expected behavior of the original code for reproduction? If we aren't supposed to call Fontour on input like above in the first place, how is Colorbar supposed to behave and why does the the API warning even matter?
I was able to suppress the failed test case with the following change to @quinnah's test case from #24656
def test_contour_uniformfield_colorbar(): # Smoke test for issue fig, ax = plt.subplots() with pytest.warns(Warning) as record: cs = ax.contour([[2, 2], [2, 2]]) assert len(record) == 1 try: fig.colorbar(cs, ax=ax) except: passPR Checklist
Documentation and Tests
Release Notes