adding check_xytext for NaN values #30381
Draft
+21
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR summary
Closes #29516 , I have a few things to address here, this PR fixes errors for this type of case:
It checks that the coordinates for xytext are a finite number, and if it isn't, the text and the arrow are not drawn, same behaviour as check_xy.
I wasn't able to reproduce the first error in the thread in a similar environment, and for this other piece of code:
the error seems to be related to set_ylim, if you remove that, it works. Also, if you change the y coordinate for xy to be less than ylim's bottom, for example:
it seems to work for anything < ylim's bottom (.25 in this case), so I guess the error appears when the text is supposed to be visible, this behaviour is weird and the easiest solution I can think of is just to not apply/allow ylim because it doesn't do anything in polar coordinates, but I don't have enough context to know if that's a good idea or even possible so I would like feedback on that 🙂.
PR checklist