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

Inf error when plotting nodes with same x, y location #197

Open
jamesmulhern opened this issue Mar 12, 2024 · 3 comments
Open

Inf error when plotting nodes with same x, y location #197

jamesmulhern opened this issue Mar 12, 2024 · 3 comments

Comments

@jamesmulhern
Copy link

When using the x,y,z attribute, and error rises if multiple nodes share the same location.

The exact error text is

ArgumentError: matrix contains Infs or NaNs

It appears to be a LinearAlegbra error that is rising inside the nearest_intersection function.

@BeastyBlacksmith
Copy link
Member

BeastyBlacksmith commented Mar 12, 2024

Please provide the complete stacktrace

@jamesmulhern
Copy link
Author

jamesmulhern commented Mar 13, 2024

ERROR: ArgumentError: matrix contains Infs or NaNs
Stacktrace:
  [1] chkfinite
    @ ~/julia/julia-1.9.3/share/julia/stdlib/v1.9/LinearAlgebra/src/lapack.jl:86 [inlined]
  [2] getrf!(A::Matrix{Float64}; check::Bool)
    @ LinearAlgebra.LAPACK ~/julia/julia-1.9.3/share/julia/stdlib/v1.9/LinearAlgebra/src/lapack.jl:559
  [3] getrf!
    @ ~/julia/julia-1.9.3/share/julia/stdlib/v1.9/LinearAlgebra/src/lapack.jl:557 [inlined]
  [4] #lu!#170
    @ ~/julia/julia-1.9.3/share/julia/stdlib/v1.9/LinearAlgebra/src/lu.jl:81 [inlined]
  [5] lu!
    @ ~/julia/julia-1.9.3/share/julia/stdlib/v1.9/LinearAlgebra/src/lu.jl:80 [inlined]
  [6] #lu#176
    @ ~/julia/julia-1.9.3/share/julia/stdlib/v1.9/LinearAlgebra/src/lu.jl:299 [inlined]
  [7] lu (repeats 2 times)
    @ ~/julia/julia-1.9.3/share/julia/stdlib/v1.9/LinearAlgebra/src/lu.jl:298 [inlined]
  [8] \(A::Matrix{Float64}, B::Vector{Float64})
    @ LinearAlgebra ~/julia/julia-1.9.3/share/julia/stdlib/v1.9/LinearAlgebra/src/generic.jl:1115
  [9] nearest_intersection(xs::Float64, ys::Float64, xd::Float64, yd::Float64, vec_xy_d::Vector{Tuple{Float64, Float64}})
    @ GraphRecipes ~/.julia/packages/GraphRecipes/rzVTu/src/utils.jl:113
 [10] macro expansion
    @ ~/.julia/packages/GraphRecipes/rzVTu/src/graphs.jl:683 [inlined]
 [11] apply_recipe(plotattributes::AbstractDict{Symbol, Any}, g::GraphRecipes.GraphPlot)
    @ GraphRecipes ~/.julia/packages/RecipesBase/BRe07/src/RecipesBase.jl:300
 [12] _process_userrecipes!(plt::Any, plotattributes::Any, args::Any)
    @ RecipesPipeline ~/.julia/packages/RecipesPipeline/BGM3l/src/user_recipe.jl:38
 [13] recipe_pipeline!(plt::Any, plotattributes::Any, args::Any)
    @ RecipesPipeline ~/.julia/packages/RecipesPipeline/BGM3l/src/RecipesPipeline.jl:72
 [14] _plot!(plt::Plots.Plot, plotattributes::Any, args::Any)
    @ Plots ~/.julia/packages/Plots/sxUvK/src/plot.jl:223
 [15] #plot#188
    @ ~/.julia/packages/Plots/sxUvK/src/plot.jl:102 [inlined]
 [16] plot
    @ ~/.julia/packages/Plots/sxUvK/src/plot.jl:93 [inlined]
 [17] #graphplot#80
    @ ~/.julia/packages/RecipesBase/BRe07/src/RecipesBase.jl:380 [inlined]
 [18] main()
    @ Main ~/Thesis/GraphGeneration/bin/GTFS_Graph_Test.jl:365
 [19] top-level scope
    @ ~/Thesis/GraphGeneration/bin/GTFS_Graph_Test.jl:374
    ```

@jamesmulhern
Copy link
Author

I was able to circumvent the issue by adding a small random value to each x and y location.

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

2 participants