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
BUG: endless loop with MaxNLocator integer kwarg and short axis #6849
Comments
The choices are to allow fewer than 2 ticks (as few as zero) in the integer case, or to expand the viewLim as needed to include at least 2 ticks. |
This is tough. Expanding the viewLim is bad because we could be over-riding user input, no ticks is bad because that is a useless plot. |
Is there a way to warn the user in the case he/she asked for integer ticks but the viewLim is too narrow for displaying any tick? Because one solution might be to opt for allowing fewer than 2 ticks in the integer case, and throw a warning if in the end there is 0 tick plotted. That way, one does not override any user input and the user is aware that he might have asked for a “useless” plot (meaning a plot with integer tick positions but with no integer values plotted, for example). |
There is one more alternative: document the 'integer' kwarg as a preference that will be overridden if it would lead to fewer than 2 ticks. I think this is the way to go. |
ENH: Rework MaxNLocator, eliminating infinite loop; closes #6849
ENH: Rework MaxNLocator, eliminating infinite loop; closes #6849
backported to v2.x as 9982e40 |
In v2.x:
This leads to an infinite loop in
MaxNLocator._raw_ticks
.The text was updated successfully, but these errors were encountered: