Skip to content

corner plot issue  #457

Closed
Closed
@yebai

Description

@yebai

The following example errors. It seems the issue is from upper stream packages instead of MCMCChains.

Note that the corner plot works fine when the number of variables is smaller than 3.

julia> val = rand(500, 4, 3);

julia> chn = Chains(val, [:a, :b, :c, :d]);

julia> corner(chn)


ERROR: The sum of widths must be 1!
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] Plots.GridLayout(::Int64, ::Vararg{…}; parent::Plots.RootLayout, widths::Vector{…}, heights::Vector{…}, kw::@Kwargs{})
    @ Plots ~/.julia/packages/Plots/ju9dp/src/layouts.jl:232
  [3] grid(::Int64, ::Vararg{Int64}; kw::@Kwargs{widths::Vector{Float64}, heights::Vector{Float64}})
    @ Plots ~/.julia/packages/Plots/ju9dp/src/layouts.jl:209
  [4] macro expansion
    @ ~/.julia/packages/StatsPlots/cStOe/src/cornerplot.jl:29 [inlined]
  [5] apply_recipe(plotattributes::AbstractDict{Symbol, Any}, cp::StatsPlots.CornerPlot)
    @ StatsPlots ~/.julia/packages/RecipesBase/BRe07/src/RecipesBase.jl:300
  [6] _process_userrecipes!(plt::Any, plotattributes::Any, args::Any)
    @ RecipesPipeline ~/.julia/packages/RecipesPipeline/BGM3l/src/user_recipe.jl:38
  [7] recipe_pipeline!(plt::Any, plotattributes::Any, args::Any)
    @ RecipesPipeline ~/.julia/packages/RecipesPipeline/BGM3l/src/RecipesPipeline.jl:72
  [8] _plot!(plt::Plots.Plot, plotattributes::Any, args::Any)
    @ Plots ~/.julia/packages/Plots/ju9dp/src/plot.jl:223
  [9] #plot#188
    @ ~/.julia/packages/Plots/ju9dp/src/plot.jl:102 [inlined]
 [10] plot
    @ ~/.julia/packages/Plots/ju9dp/src/plot.jl:93 [inlined]
 [11] corner(args::Chains{Float64, AxisArrays.AxisArray{…}, Missing, @NamedTuple{…}, @NamedTuple{}})
    @ MCMCChains ~/.julia/packages/RecipesBase/BRe07/src/RecipesBase.jl:427
 [12] top-level scope
    @ REPL[53]:1
Some type information was truncated. Use `show(err)` to see complete types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions