-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
Fix invalid range logscale #1671
Conversation
Just noted that running the |
I looked into issue with the annotations. Consider this part of the code https://github.com/JuliaPlots/Makie.jl/blob/559416f27363519dde25b5faea79fd201131cbd6/src/makielayout/layoutables/axis.jl#L751-L772 julia> text(". This is an annotation!", position=(300,200))
GeometryBasics.HyperRectangle{3, Float32}(Float32[300.0, 200.0, 0.0], Float32[0.0, 0.0, 0.0])
GeometryBasics.HyperRectangle{3, Float32}(Float32[300.0, 200.0, 0.0], Float32[0.0, 0.0, 0.0]) This suggests that the text box's Q1: Is zero width for text boxes intended or a bug? |
Just read the docs at https://makie.juliaplots.org/v0.15.1/examples/layoutables/axis/index.html and it says that
So it seems like equal axis limits should not be ruled out or? Could somebody please confirm? If so, then the solution for #1670 has to be different. |
Limits where min == max should not be allowed, it doesn't make sense as all projection math in the scene breaks down in that case. It probably breaks down much earlier if we have really small distances between min and max, but I guess that is a different issue. I have to check the logic again to make sure that the point where the equal limits are checked is the earliest-possible point, so that all logic behind that can assume non-zero-width limits. In principle, a zero width boundingbox for a plot is fine (as in the annotation case), that just means there's only one data point (the anchor of the text). But this can't proliferate to the actual axis limits. It shouldn't, as I have logic in the autolimits function that expands zero-width auto limits, I'll have to check this specific case here. |
Thanks for the clarification.
I think that is actually happening in #1670, which lead to this PR. |
Closing in favor of #3077 |
Description
Fixes #1670
Avoid equal axis limits and fall back to default ones.
I also modified
validate_limits_for_scale
to error if equal axis limits are encountered even if no log scale is set. Is this ok?Previously this did not error on standard axis, e.g.
worked.
Should I also add units test for this?
Type of change
Delete options that do not apply:
Checklist