Skip to content
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

Large (but < max possible Float32 value) numbers cause zoom to fail (exception) #3738

Closed
3 tasks done
thomvet opened this issue Mar 26, 2024 · 3 comments
Closed
3 tasks done
Labels

Comments

@thomvet
Copy link

thomvet commented Mar 26, 2024

  • are you running newest version (version from docs) ? - Yes, Makie 0.20.8 and GLMakie 0.9.9
  • can you reproduce the bug with a fresh environment ? (]activate --temp; add Makie) - yes, below report is with fresh environment
  • What platform + GPU are you on? - Windows + NVIDIA RTX A3000 12GB Laptop GPU

Issue: Creating a simple scatter plot can cause issues when attempting to rectangle zoom in the plot:

using GLMakie

scatter(0:10, 1e34 .* rand(11)) #Plot is zoomable with mouse as normal
scatter(0:10, 1e35 .* rand(11)) #GLMakie causes exception, see below

Zooming in the first plot (1e34 ...) works as normal.
Zooming in the second plot causes the below exception message in the julia session.

Is this maybe related to displaying a large number close to Float32 limit? But the maximum number displayable in Float32 should be ~3.4 x 10^38 and we are still a little away from it here?

julia> ┌ Warning: error in rectangle zoom
│   exception =
│    Invalid x-limits (NaN32, NaN32) for scale identity which is defined on the interval -Inf .. Inf (open)
│    Stacktrace:
│      [1] error(s::String)
│        @ Base .\error.jl:35
│      [2] validate_limits_for_scales(lims::GeometryBasics.HyperRectangle{2, Float32}, xsc::Function, ysc::Function)
│        @ Makie C:\Users\thvt\.julia\packages\Makie\VRavR\src\makielayout\blocks\axis.jl:662
│      [3] (::Makie.var"#1554#1584"{Axis})(lims::GeometryBasics.HyperRectangle{2, Float32})
│        @ Makie C:\Users\thvt\.julia\packages\Makie\VRavR\src\makielayout\blocks\axis.jl:180
│      [4] #invokelatest#2
│        @ .\essentials.jl:892 [inlined]
│      [5] invokelatest
│        @ .\essentials.jl:889 [inlined]
│      [6] notify
│        @ C:\Users\thvt\.julia\packages\Observables\YdEbO\src\Observables.jl:206 [inlined]
│      [7] setindex!(observable::Observable, val::Any)
│        @ Observables C:\Users\thvt\.julia\packages\Observables\YdEbO\src\Observables.jl:123
│      [8] (::Makie.var"#1448#1449"{Axis})(newlims::GeometryBasics.HyperRectangle{2, Float32})
│        @ Makie C:\Users\thvt\.julia\packages\Makie\VRavR\src\makielayout\types.jl:674
│      [9] process_interaction(r::Makie.RectangleZoom, event::MouseEvent, ax::Axis)
│        @ Makie C:\Users\thvt\.julia\packages\Makie\VRavR\src\makielayout\interactions.jl:181
│     [10] process_axis_event(ax::Axis, event::MouseEvent)
│        @ Makie C:\Users\thvt\.julia\packages\Makie\VRavR\src\makielayout\blocks\axis.jl:27
│     [11] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::@Kwargs{})
│        @ Base .\essentials.jl:892
│     [12] invokelatest(::Any, ::Any, ::Vararg{Any})
│        @ Base .\essentials.jl:889
│     [13] (::Observables.OnAny)(value::Any)
│        @ Observables C:\Users\thvt\.julia\packages\Observables\YdEbO\src\Observables.jl:420
│     [14] #invokelatest#2
│        @ .\essentials.jl:892 [inlined]
│     [15] invokelatest
│        @ .\essentials.jl:889 [inlined]
│     [16] notify
│        @ C:\Users\thvt\.julia\packages\Observables\YdEbO\src\Observables.jl:206 [inlined]
│     [17] setindex!
│        @ C:\Users\thvt\.julia\packages\Observables\YdEbO\src\Observables.jl:123 [inlined]
│     [18] (::Makie.var"#1441#1443"{Scene, Base.RefValue{Bool}, Base.RefValue{Union{Nothing, Makie.Mouse.Button}}, Base.RefValue{Float64}, Base.RefValue{Float64}, Base.RefValue{Bool}, Base.RefValue{Bool}, Base.RefValue{Union{Nothing, Makie.Mouse.Button}}, Base.RefValue{Bool}, Base.RefValue{Point{2, Float32}}, Base.RefValue{Point{2, Float32}}, Base.RefValue{Makie.Mouse.Action}, Observable{MouseEvent}, Float64, Module})(event::Makie.MouseButtonEvent)
│        @ Makie C:\Users\thvt\.julia\packages\Makie\VRavR\src\makielayout\mousestatemachine.jl:325
│     [19] #invokelatest#2
│        @ .\essentials.jl:892 [inlined]
│     [20] invokelatest
│        @ .\essentials.jl:889 [inlined]
│     [21] notify
│        @ C:\Users\thvt\.julia\packages\Observables\YdEbO\src\Observables.jl:206 [inlined]
│     [22] setindex!
│        @ C:\Users\thvt\.julia\packages\Observables\YdEbO\src\Observables.jl:123 [inlined]
│     [23] (::GLMakie.var"#mousebuttons#168"{Observable{Makie.MouseButtonEvent}})(window::GLFW.Window, button::GLFW.MouseButton, action::GLFW.Action, mods::Int32)
│        @ GLMakie C:\Users\thvt\.julia\packages\GLMakie\QyIWu\src\events.jl:102
│     [24] _MouseButtonCallbackWrapper(window::GLFW.Window, button::GLFW.MouseButton, action::GLFW.Action, mods::Int32)
│        @ GLFW C:\Users\thvt\.julia\packages\GLFW\BWxfF\src\callback.jl:43
│     [25] PollEvents
│        @ C:\Users\thvt\.julia\packages\GLFW\BWxfF\src\glfw3.jl:620 [inlined]
│     [26] pollevents(screen::GLMakie.Screen{GLFW.Window})
│        @ GLMakie C:\Users\thvt\.julia\packages\GLMakie\QyIWu\src\screen.jl:449
│     [27] on_demand_renderloop(screen::GLMakie.Screen{GLFW.Window})
│        @ GLMakie C:\Users\thvt\.julia\packages\GLMakie\QyIWu\src\screen.jl:937
│     [28] renderloop(screen::GLMakie.Screen{GLFW.Window})
│        @ GLMakie C:\Users\thvt\.julia\packages\GLMakie\QyIWu\src\screen.jl:963
│     [29] (::GLMakie.var"#69#70"{GLMakie.Screen{GLFW.Window}})()
│        @ GLMakie C:\Users\thvt\.julia\packages\GLMakie\QyIWu\src\screen.jl:824
└ @ Makie C:\Users\thvt\.julia\packages\Makie\VRavR\src\makielayout\interactions.jl:183
@thomvet thomvet added the bug label Mar 26, 2024
@ffreyer
Copy link
Collaborator

ffreyer commented Mar 26, 2024

This is probably a duplicate of at least one of the issues listed in #3681, but it seems to not yet be fixed. I'll have a look in a bit

@ffreyer
Copy link
Collaborator

ffreyer commented May 24, 2024

Fixed by #3731 in Makie 0.21

@ffreyer ffreyer closed this as completed May 24, 2024
@thomvet
Copy link
Author

thomvet commented May 24, 2024

Outstanding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants