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

ternaryscatter! gives typemax error #22

Closed
rpgowers opened this issue Nov 14, 2024 · 5 comments
Closed

ternaryscatter! gives typemax error #22

rpgowers opened this issue Nov 14, 2024 · 5 comments

Comments

@rpgowers
Copy link

rpgowers commented Nov 14, 2024

After updating to v0.1.2, ternaryscatter! no longer seems to work with recent versions of CairoMakie or GLMakie (ternarylines! and ternarycontourf work fine).

Here is a minimal example (CairoMakie 0.12.16):

using CairoMakie
using TernaryDiagrams
fig = Figure()
ax = Axis(fig[1, 1])
ternaryaxis!(ax)
ternaryscatter!(ax, [0.2, 0.1], [0.2, 0.6], [0.6, 0.3])
fig

and here is the error that I get:

ERROR: MethodError: no method matching typemax(::Type{Any})

Closest candidates are:
  typemax(::Type{RaymarchAlgorithm})
   @ Makie Enums.jl:216
  typemax(::Type{Makie.Keyboard.Button})
   @ Makie Enums.jl:216
  typemax(::Type{Makie.ColorMappingType})
   @ Makie Enums.jl:216
  ...
Stacktrace:
  [1] GeometryBasics.HyperRectangle{3, Float64}(geometry::Vector{Point2})
    @ GeometryBasics ~/.julia/packages/GeometryBasics/ebXl0/src/boundingboxes.jl:11
  [2] data_limits(plot::Lines{Tuple{Vector{Point2}}})
    @ Makie ~/.julia/packages/Makie/pFPBw/src/layouting/data_limits.jl:45
  [3] boundingbox(plot::Lines{Tuple{Vector{Point2}}}, space::Symbol)
    @ Makie ~/.julia/packages/Makie/pFPBw/src/layouting/boundingbox.jl:38
  [4] boundingbox(plot::Plot{TernaryDiagrams.ternaryaxis, Tuple{}}, space::Symbol)
    @ Makie ~/.julia/packages/Makie/pFPBw/src/layouting/boundingbox.jl:43
  [5] (::Makie.var"#1044#1046"{…})(plot::Plot{…})
    @ Makie ~/.julia/packages/Makie/pFPBw/src/layouting/boundingbox.jl:21
  [6] foreach(f::Makie.var"#1044#1046"{Makie.var"#exclude#1733"{…}, Symbol, Base.RefValue{…}}, itr::Vector{Plot})
    @ Base ./abstractarray.jl:3097
  [7] foreach_plot
    @ ~/.julia/packages/Makie/pFPBw/src/layouting/data_limits.jl:272 [inlined]
  [8] foreach_plot
    @ ~/.julia/packages/Makie/pFPBw/src/layouting/data_limits.jl:269 [inlined]
  [9] boundingbox
    @ ~/.julia/packages/Makie/pFPBw/src/layouting/boundingbox.jl:19 [inlined]
 [10] boundingbox
    @ ~/.julia/packages/Makie/pFPBw/src/layouting/boundingbox.jl:18 [inlined]
 [11] getlimits(la::Axis, dim::Int64)
    @ Makie ~/.julia/packages/Makie/pFPBw/src/makielayout/blocks/axis.jl:851
 [12] autolimits(ax::Axis, dim::Int64)
    @ Makie ~/.julia/packages/Makie/pFPBw/src/makielayout/blocks/axis.jl:939
 [13] xautolimits
    @ ~/.julia/packages/Makie/pFPBw/src/makielayout/blocks/axis.jl:970 [inlined]
 [14] reset_limits!(ax::Axis; xauto::Bool, yauto::Bool, zauto::Bool)
    @ Makie ~/.julia/packages/Makie/pFPBw/src/makielayout/blocks/axis.jl:570
 [15] reset_limits!
    @ ~/.julia/packages/Makie/pFPBw/src/makielayout/blocks/axis.jl:557 [inlined]
 [16] update_state_before_display!(ax::Axis)
    @ Makie ~/.julia/packages/Makie/pFPBw/src/figureplotting.jl:403
 [17] update_state_before_display!(f::Figure)
    @ Makie ~/.julia/packages/Makie/pFPBw/src/figureplotting.jl:275
 [18] display(figlike::Figure; backend::Module, inline::MakieCore.Automatic, update::Bool, screen_config::@Kwargs{})
    @ Makie ~/.julia/packages/Makie/pFPBw/src/display.jl:164
 [19] display(figlike::Figure)
    @ Makie ~/.julia/packages/Makie/pFPBw/src/display.jl:130
 [20] #invokelatest#2
    @ ./essentials.jl:892 [inlined]
 [21] invokelatest
    @ ./essentials.jl:889 [inlined]
 [22] print_response(errio::IO, response::Any, show_value::Bool, have_color::Bool, specialdisplay::Union{…})
    @ REPL ~/.julia/juliaup/julia-1.10.5+0.x64.linux.gnu/share/julia/stdlib/v1.10/REPL/src/REPL.jl:315
 [23] (::REPL.var"#57#58"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
    @ REPL ~/.julia/juliaup/julia-1.10.5+0.x64.linux.gnu/share/julia/stdlib/v1.10/REPL/src/REPL.jl:284
 [24] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL ~/.julia/juliaup/julia-1.10.5+0.x64.linux.gnu/share/julia/stdlib/v1.10/REPL/src/REPL.jl:569
 [25] print_response(repl::REPL.AbstractREPL, response::Any, show_value::Bool, have_color::Bool)
    @ REPL ~/.julia/juliaup/julia-1.10.5+0.x64.linux.gnu/share/julia/stdlib/v1.10/REPL/src/REPL.jl:282
 [26] (::REPL.var"#do_respond#80"{…})(s::REPL.LineEdit.MIState, buf::Any, ok::Bool)
    @ REPL ~/.julia/juliaup/julia-1.10.5+0.x64.linux.gnu/share/julia/stdlib/v1.10/REPL/src/REPL.jl:911
    @ REPL ~/.julia/juliaup/julia-1.10.5+0.x64.linux.gnu/share/julia/stdlib/v1.10/REPL/src/REPL.jl:1312
 [31] (::REPL.var"#62#68"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL ~/.julia/juliaup/julia-1.10.5+0.x64.linux.gnu/share/julia/stdlib/v1.10/REPL/src/REPL.jl:386
@thomvet
Copy link
Contributor

thomvet commented Nov 19, 2024

This is weird; we do test ternaryscatter in the testset and tests passed.

Can you provide

  1. Output of using Pkg; Pkg.status()

  2. Output of using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)

Just to be sure what versions you are on.

@thomvet
Copy link
Contributor

thomvet commented Nov 19, 2024

I can reproduce this. However, I briefly tried around today during lunch break and saw that the error does not happen when the xlims!/ylims! commands are used before displaying the figure.

No idea why yet!

@thomvet
Copy link
Contributor

thomvet commented Nov 20, 2024

I narrowed it down a little bit. Your code works as intended with [email protected] and [email protected]. The problem occurs with the newer Makie 0.21 version.

Not a problem solution yet, but at least I narrowed down the problem and I know that something is done differently in Makie that now causes the issue here...

@rpgowers
Copy link
Author

Thanks for looking into this. Sorry for the lack of feedback early, was not receiving notifications on this thread for some reason.

@stelmo
Copy link
Owner

stelmo commented Dec 10, 2024

#23 should close this

@stelmo stelmo closed this as completed Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants