-
Notifications
You must be signed in to change notification settings - Fork 48
Remove threshold from SubPlot.auto_scale #810
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
base: main
Are you sure you want to change the base?
Conversation
I'm pretty sure this was due to floating point error where the width and height can be very close to zero after extensive panning and zooming. |
That seems likely indeed, but it seems like a quick fix that does not work in general, since it is reasonable for an axis to have very small values when showing scientific data (a nice plot would often benefit from proper units like If this is an error caused by ill-conditioning after zooming and panning, I think that it should be possible to find better fixes. I also encountered some issues with extensive zooming (see pygfx/pygfx#1081), so I'm interested in finding a proper solution to that problem. Do you have a testcase for the bug that motivated the introduction of this threshold? |
Ah good point, we'll have to think of a better fix
pint would be a good way to do this, see #729 , setting units on a reference frame (see #772) would probably be a good way to do this. |
|
When comparing to |
Perhaps anything that is 1 bit above |
By "1 bit above 0", if you mean the smallest non-zero positive float32, this is about I can update the PR to go from |
Sounds like that should work, hardcoding the binary value should work, |
BTW looking at your actual use-case repo, I think your And from this example it looks like you're just trying to create a https://github.com/cassiersg/scaviz/blob/main/examples/traces_plot.ipynb If you describe what you're trying to do we can help better. |
I switched to
Thanks for the suggestion. I started a discussion here to not derail this thread. (This PR is not discussed there, I noticed this issue when my code was buggy, I don't have a plot with scales below 0.01 anymore - but I expect to have it in the future.) |
From what I could see, the threshold was arbitrary. It is also not clear that any non-zero value should be a threshold, since all computations should work over the full range of a 32-bit float.