Open KronosTheLate opened 2 years ago
Can you try not passing Int vectors but Float64? Your error looks more like an Int problem than anything in Makie.
julia> using GLMakie
julia> using Distributions
julia> using GLMakie
julia> plot(MvNormal([1.0, 2.0], [3.0, 4.0]))
ERROR: MethodError: no method matching iterate(::DiagNormal)
Closest candidates are:
iterate(::Union{LinRange, StepRangeLen}) at C:\Users\Dennis Bal\.julia\juliaup\julia-1.7.2+0~x64\share\julia\base\range.jl:826
iterate(::Union{LinRange, StepRangeLen}, ::Integer) at C:\Users\Dennis Bal\.julia\juliaup\julia-1.7.2+0~x64\share\julia\base\range.jl:826
iterate(::T) where T<:Union{Base.KeySet{<:Any, <:Dict}, Base.ValueIterator{<:Dict}} at C:\Users\Dennis Bal\.julia\juliaup\julia-1.7.2+0~x64\share\julia\base\dict.jl:695
...
Stacktrace:
[1] copyto!(dest::Vector{Float64}, src::DiagNormal)
@ Base .\abstractarray.jl:890
[2] _collect(cont::UnitRange{Int64}, itr::DiagNormal, #unused#::Base.HasEltype, isz::Base.HasLength)
@ Base .\array.jl:655
[3] collect(itr::DiagNormal)
@ Base .\array.jl:649
[4] quantile(itr::DiagNormal, p::Float64; sorted::Bool, alpha::Float64, beta::Float64)
@ Statistics C:\Users\Dennis Bal\.julia\juliaup\julia-1.7.2+0~x64\share\julia\stdlib\v1.7\Statistics\src\Statistics.jl:1070
[5] quantile(itr::DiagNormal, p::Float64)
@ Statistics C:\Users\Dennis Bal\.julia\juliaup\julia-1.7.2+0~x64\share\julia\stdlib\v1.7\Statistics\src\Statistics.jl:1070
[6] default_range(dist::DiagNormal, alpha::Float64) (repeats 2 times)
@ Makie C:\Users\Dennis Bal\.julia\packages\Makie\Ws9gB\src\stats\distributions.jl:8
[7] support
@ C:\Users\Dennis Bal\.julia\packages\Makie\Ws9gB\src\stats\distributions.jl:16 [inlined]
[8] convert_arguments(P::Type{Combined{Any, Tuple{DiagNormal}}}, dist::DiagNormal)
@ Makie C:\Users\Dennis Bal\.julia\packages\Makie\Ws9gB\src\stats\distributions.jl:19
[9] plot!(scene::Scene, P::Type{Any}, attributes::Attributes, args::DiagNormal; kw_attributes::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Makie C:\Users\Dennis Bal\.julia\packages\Makie\Ws9gB\src\interfaces.jl:302
[10] plot!(scene::Scene, P::Type{Any}, attributes::Attributes, args::DiagNormal)
@ Makie C:\Users\Dennis Bal\.julia\packages\Makie\Ws9gB\src\interfaces.jl:288
[11] plot(P::Type{Any}, args::DiagNormal; axis::NamedTuple{(), Tuple{}}, figure::NamedTuple{(), Tuple{}}, kw_attributes::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Makie C:\Users\Dennis Bal\.julia\packages\Makie\Ws9gB\src\figureplotting.jl:28
[12] plot(P::Type{Any}, args::DiagNormal)
@ Makie C:\Users\Dennis Bal\.julia\packages\Makie\Ws9gB\src\figureplotting.jl:16
[13] plot(args::DiagNormal; attributes::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ MakieCore C:\Users\Dennis Bal\.julia\packages\MakieCore\C4HO7\src\recipes.jl:33
[14] plot(args::DiagNormal)
@ MakieCore C:\Users\Dennis Bal\.julia\packages\MakieCore\C4HO7\src\recipes.jl:33
[15] top-level scope
@ REPL[16]:1
This seems to be a totally different error. However, both attempts should work, right?
I love how easy it is to plot a PDF with Distributions and Makie. The following just works
However, the following fails
I get that the multivariate case can not be generally supported, but with 2 variables plotting could be automatic. Could this be added?