-
-
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
support images with reversed axes #3989
Conversation
should it go to the changelog? not a new feature, just fixing existing behavior, making it more uniform and consistent |
Yeah definitely changelog worthy I'd say |
added! |
bump... |
This works for me across GLMakie, CairoMakie and WGLMakie for |
Oh I missed your response somehow. I got things a bit mixed up in my comment. Testing again I get: Heatmap:
Image:
Thinking about it again it's probably not necessary to get ranges and vectors to work for Image since they are deprecated. Interval in heatmap should be fixed though. And the refimg should test everything that works, i.e. reversed Interval, Range and Vector for heatmap and reversed Interval for image. Edit: Next two commits resolve this |
to_linspace(interval::Interval, N) = range(leftendpoint(interval), stop = rightendpoint(interval), length = N) | ||
to_linspace(x, N) = range(first(x), stop = last(x), length = N) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SimonDanisch @jkrumbiegel Is it fine to switch away from minimum
and maximum
to enable reverse image/heatmap axes? Should we consider this breaking?
(This is fixing the points I made in the last comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this change is fine we can merge this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that in the code path, that already warns for vectors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I guess it is... So we don't allow vectors for images anymore anyways 🤷
It's not yet erroring, but should already warn to not use it.
So shouldn't be breaking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have two functions with that change here:
to_interval
affecting Image, Volume (errors in data_limits with reversed axis though)to_linspace
affecting PointBased w/ (Interval, Interval, Matrix), heatmap
What changed as far as I can tell:
- heatmap no longer errors for reverse intervals but otherwise works the same (is the RangeLike convert not getting hit?)
- image no longer errors on reverse intervals and allows for reversing, which it previously didn't. This is visually different
- PointBased no longer errors with (Interval, Interval, Matrix), but still with something like (Interval, Vector)
- volume errors in data_limits instead of convert_arguments with reversed limits
Bump :) |
Any issues with this?.. Or suggestions on how to proceed with this bugfix? |
another bump... |
Sorry I guess we're all a bit unsure how to best do this, and if this PR is enough and whether we have enough tests. |
Hmm, the new behavior for reversed axes seems worse: earlier, it threw an error, but now displays the exact same plot as non-reversed: Trying to understand Makie.jl/MakieCore/src/types.jl Line 154 in 8617742
Best to make a new PR on top of the current master I guess. |
Maybe I started using |
Description
The whole pipeline almost-supported them already, here I just make a few minor fixes where the assumption of increasing values was baked in.
Type of change
Checklist