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

Contour errored when data contain NaN and labels=true #3211

Closed
3 tasks done
Lightup1 opened this issue Sep 5, 2023 · 1 comment · Fixed by #3210
Closed
3 tasks done

Contour errored when data contain NaN and labels=true #3211

Lightup1 opened this issue Sep 5, 2023 · 1 comment · Fixed by #3210
Labels
bug CairoMakie This relates to CairoMakie, the vector backend for Makie based on Cairo.

Comments

@Lightup1
Copy link

Lightup1 commented Sep 5, 2023

  • are you running newest version (version from docs) ?
  • can you reproduce the bug with a fresh environment ? (]activate --temp; add Makie)
  • What platform + GPU are you on?
    Julia1.10 beta2, Windows, intel GPU.

Code example:

using CairoMakie
let
    a=1:3
    b=1:3
    d=[0 1 2;1 2 3;4 5 NaN]
    contour(a,b,d,levels=[1,2,3],labels=true)
end
error message
ERROR: Invalid text boundingbox
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:35
  [2] boundingbox(glyphcollection::Makie.GlyphCollection, rotation::Quaternionf)
    @ Makie C:\Users\42158\.julia\packages\Makie\Ylh0P\src\layouting\boundingbox.jl:72
  [3] boundingbox(glyphcollection::Makie.GlyphCollection, rotation::Quaternionf)
    @ Makie C:\Users\42158\.julia\packages\Makie\Ylh0P\src\layouting\boundingbox.jl:52 [inlined]
  [4] (::Makie.var"#515#522"{Combined{}, Symbol, Scene})(gc::Makie.GlyphCollection, pt::Point{2, Float32}, rot::Float32)
    @ Makie C:\Users\42158\.julia\packages\Makie\Ylh0P\src\basic_recipes\contours.jl:284
  [5] _broadcast_getindex_evalf
    @ Base.Broadcast .\broadcast.jl:709 [inlined]
  [6] _broadcast_getindex
    @ Base.Broadcast .\broadcast.jl:682 [inlined]
  [7] getindex
    @ Base.Broadcast .\broadcast.jl:636 [inlined]
  [8] macro expansion
    @ Base.Broadcast .\broadcast.jl:1004 [inlined]
  [9] macro expansion
    @ Base.Broadcast .\simdloop.jl:77 [inlined]
 [10] copyto!
    @ Base.Broadcast .\broadcast.jl:1003 [inlined]
 [11] copyto!
    @ Base.Broadcast .\broadcast.jl:956 [inlined]
 [12] copy
    @ Base.Broadcast .\broadcast.jl:928 [inlined]
 [13] materialize
    @ Base.Broadcast .\broadcast.jl:903 [inlined]
 [14] broadcast(::Makie.var"#515#522"{}, ::Vector{…}, ::Vector{…}, ::Vector{…})
    @ Base.Broadcast .\broadcast.jl:841
 [15] (::Makie.var"#514#521"{Combined{}, MakieCore.Text{}, Symbol, Scene})(labels::Bool, ::Vector{String})
    @ Makie C:\Users\42158\.julia\packages\Makie\Ylh0P\src\basic_recipes\contours.jl:281
 [16] #map#13
    @ Observables C:\Users\42158\.julia\packages\Observables\PHGQ8\src\Observables.jl:564 [inlined]
 [17] plot!(plot::Combined{Makie.contour, Tuple{Vector{Float32}, Vector{Float32}, Matrix{Float32}}})
    @ Makie C:\Users\42158\.julia\packages\Makie\Ylh0P\src\basic_recipes\contours.jl:279
 [18] plot!(scene::Scene, P::Type{…}, attributes::Attributes, input::Tuple{…}, args::Observable{…})
    @ Makie C:\Users\42158\.julia\packages\Makie\Ylh0P\src\interfaces.jl:398
 [19] plot!(::Scene, ::Type{Combined{…}}, ::Attributes, ::UnitRange{Int64}, ::Vararg{Any}; kw_attributes::@Kwargs{})
    @ Makie C:\Users\42158\.julia\packages\Makie\Ylh0P\src\interfaces.jl:310
 [20] plot!(::Scene, ::Type{Combined{Makie.contour}}, ::Attributes, ::UnitRange{Int64}, ::UnitRange{Int64}, ::Matrix{Float64})
    @ Makie C:\Users\42158\.julia\packages\Makie\Ylh0P\src\interfaces.jl:275
 [21] plot(::Type{…}, ::UnitRange{…}, ::Vararg{…}; axis::@NamedTuple{}, figure::@NamedTuple{}, kw_attributes::@Kwargs{})
    @ Makie C:\Users\42158\.julia\packages\Makie\Ylh0P\src\figureplotting.jl:48
 [22] contour(::UnitRange{Int64}, ::Vararg{Any}; attributes::@Kwargs{levels::Vector{Int64}, labels::Bool})
    @ Makie C:\Users\42158\.julia\packages\MakieCore\zgrOY\src\recipes.jl:34
 [23] top-level scope
    @ REPL[5]:5
Some type information was truncated. Use `show(err)` to see complete types.
@Lightup1 Lightup1 added the bug label Sep 5, 2023
@Lightup1
Copy link
Author

Lightup1 commented Sep 5, 2023

Ploting contour with NaN of data replaced by Inf triggers similar error message.

@t-bltg t-bltg added the CairoMakie This relates to CairoMakie, the vector backend for Makie based on Cairo. label Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug CairoMakie This relates to CairoMakie, the vector backend for Makie based on Cairo.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants