Hi,
I'm trying to plot an MCMCChain, calling plot(chain), in vscode and receive the error message below. Plotting in general works fine.
The same GKS error also occurs in the repl outside vscode but there is no stacktrace.
using Turing, Distributions
using CSV
using DataFrames
using MCMCChains, Plots, StatsPlots
using Random
Random.seed!(0)
df = CSV.read("data/howell.csv", DataFrame)
gdf = filter(:age => x -> x > 18, df)
@model function linear_model(x, y)
# Set variance prior
σ2 ~ Uniform(0.0, 10.0);
α ~ Normal(60, 10);
nfeatures=size(x)
β ~ MvLogNormal(zeros(nfeatures), ones(nfeatures));
μ = α .+ β .* (x .- mean(x));
y ~ MvNormal(μ, sqrt(σ2));
end
model = linear_model(gdf[!, :height], gdf[!, :weight])
chain = sample(model, NUTS(0.65), 1_000);
plot(chain)
Hi, I'm trying to plot an MCMCChain, calling plot(chain), in vscode and receive the error message below. Plotting in general works fine. The same
GKS
error also occurs in the repl outside vscode but there is no stacktrace.GKS: Rectangle definition is invalid in routine SET_VIEWPORT GKS: Rectangle definition is invalid in routine SET_VIEWPORT [...] Repeats a lot ... GKS: Rectangle definition is invalid in routine SET_VIEWPORT ERROR: SystemError: opening file "/var/folders/2p/kw9s71xx0fl6c0_t44p9lb580000gn/T/jl_JP1zoR.png": No such file or directory Stacktrace: [1] systemerror(p::String, errno::Int32; extrainfo::Nothing) @ Base ./error.jl:174 [2] #systemerror#68 @ ./error.jl:173 [inlined] [3] systemerror @ ./error.jl:173 [inlined] [4] open(fname::String; lock::Bool, read::Nothing, write::Nothing, create::Nothing, truncate::Nothing, append::Nothing) @ Base ./iostream.jl:293 [5] open @ ./iostream.jl:282 [inlined] [6] open(f::Base.var"#364#365"{String}, args::String; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}) @ Base ./io.jl:328 [7] open @ ./io.jl:328 [inlined] [8] read @ ./io.jl:436 [inlined] [9] _show(io::Base64.Base64EncodePipe, #unused#::MIME{Symbol("image/png")}, plt::Plots.Plot{Plots.GRBackend}) @ Plots ~/.julia/packages/Plots/dNEbX/src/backends/gr.jl:2171 [10] show(io::Base64.Base64EncodePipe, m::MIME{Symbol("image/png")}, plt::Plots.Plot{Plots.GRBackend}) @ Plots ~/.julia/packages/Plots/dNEbX/src/output.jl:212 [11] base64encode(::Function, ::MIME{Symbol("image/png")}, ::Vararg{Any}; context::Nothing) @ Base64 /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/Base64/src/encode.jl:209 [12] _binstringmime @ /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/Base64/src/Base64.jl:46 [inlined] [13] stringmime(m::MIME{Symbol("image/png")}, x::Plots.Plot{Plots.GRBackend}; context::Nothing) @ Base64 /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/Base64/src/Base64.jl:43 [14] stringmime @ /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/Base64/src/Base64.jl:43 [inlined] [15] display(d::VSCodeServer.InlineDisplay, m::MIME{Symbol("image/png")}, x::Plots.Plot{Plots.GRBackend}) @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.17/scripts/packages/VSCodeServer/src/display.jl:57 [16] display(d::VSCodeServer.InlineDisplay, mime::String, x::Any) @ Base.Multimedia ./multimedia.jl:216 [17] display(d::VSCodeServer.InlineDisplay, x::Plots.Plot{Plots.GRBackend}) @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.17/scripts/packages/VSCodeServer/src/display.jl:165 [18] display(x::Any) @ Base.Multimedia ./multimedia.jl:328 [19] #invokelatest#2 @ ./essentials.jl:716 [inlined] [20] invokelatest @ ./essentials.jl:714 [inlined] [21] (::VSCodeServer.var"#65#69"{Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})() @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.17/scripts/packages/VSCodeServer/src/eval.jl:176 [22] withpath(f::VSCodeServer.var"#65#69"{Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams}, path::String) @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.17/scripts/packages/VSCodeServer/src/repl.jl:184 [23] (::VSCodeServer.var"#64#68"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})() @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.17/scripts/packages/VSCodeServer/src/eval.jl:153 [24] hideprompt(f::VSCodeServer.var"#64#68"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams}) @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.17/scripts/packages/VSCodeServer/src/repl.jl:36 [25] (::VSCodeServer.var"#63#67"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})() @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.17/scripts/packages/VSCodeServer/src/eval.jl:124 [26] with_logstate(f::Function, logstate::Any) @ Base.CoreLogging ./logging.jl:511 [27] with_logger @ ./logging.jl:623 [inlined] [28] (::VSCodeServer.var"#62#66"{VSCodeServer.ReplRunCodeRequestParams})() @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.17/scripts/packages/VSCodeServer/src/eval.jl:201 [29] #invokelatest#2 @ ./essentials.jl:716 [inlined] [30] invokelatest(::Any) @ Base ./essentials.jl:714 [31] macro expansion @ ~/.vscode/extensions/julialang.language-julia-1.6.17/scripts/packages/VSCodeServer/src/eval.jl:34 [inlined] [32] (::VSCodeServer.var"#60#61")() @ VSCodeServer ./task.jl:423
julia>