Interpret this Julia error message using PGFPlotsX – key error

huangapple go评论62阅读模式
英文:

Interpret this Julia error message using PGFPlotsX - key error

问题

I am witnessing strange behavior with Julia 1.8.5 using the latest Plots PGFPlots(X) packages. When adding the call pgfplotsx(), I am not getting any output. A minimal working example (MWE) using Plots:

using Plots
plot(rand(20))

gives the desired output, but adding pgfplotsx() before the plot results in blank output. There seems to be an error related to PGFPlotsX.Options(OrderedCollections.OrderedDict{String, Any}("color" => RGBA{Float64}(0.0,0.0,0.0,1.0), "draw opacity" => 1.0, "line width" => 1, "solid" => nothing), false). Can you help me interpret this error?

英文:

I am witnessing strange behaviour with Julia 1.8.5 using the latest of Plots PGFPlots(X) packages.

When adding the call pgfplotsx() I am not getting any output. A MWE is

using Plots
plot(rand(20))

gives the desired output but

using Plots
pgfplotsx()
plot(rand(20))

results in blank output.

What is going on or how could I debug this?

When installing Julia packages, there were problems with a package called init. Could that be related to this problem?

I had the idea to run it in a REPL and that gave me a much-needed error message. Can someone help me interpret it?

Error showing value of type Plots.Plot{Plots.PGFPlotsXBackend}:
ERROR: Invalid pgf key PGFPlotsX.Options(OrderedCollections.OrderedDict{String, Any}("color" => RGBA{Float64}(0.0,0.0,0.0,1.0), "draw opacity" => 1.0, "line width" => 1, "solid" => nothing), false)
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] normalize_key(x::PGFPlotsX.Options)
    @ PGFPlotsX ~/.julia/packages/PGFPlotsX/wtVR1/src/options.jl:10
  [3] PGFPlotsX.Options(::Pair{PGFPlotsX.Options, Nothing}, ::Vararg{Union{PGFPlotsX.MergeEntry, Pair}}; print_empty::Bool)
    @ PGFPlotsX ~/.julia/packages/PGFPlotsX/wtVR1/src/options.jl:46
  [4] PGFPlotsX.Options(::Pair{PGFPlotsX.Options, Nothing}, ::Vararg{Union{PGFPlotsX.MergeEntry, Pair}})
    @ PGFPlotsX ~/.julia/packages/PGFPlotsX/wtVR1/src/options.jl:41
  [5] pgfx_get_legend_style(sp::Plots.Subplot{Plots.PGFPlotsXBackend})
    @ Plots ~/.julia/packages/Plots/tDHxD/src/backends/pgfplotsx.jl:768
  [6] (::Plots.PGFPlotsXPlot)(plt::Plots.Plot{Plots.PGFPlotsXBackend})
    @ Plots ~/.julia/packages/Plots/tDHxD/src/backends/pgfplotsx.jl:142
  [7] _update_plot_object(plt::Plots.Plot{Plots.PGFPlotsXBackend})
    @ Plots ~/.julia/packages/Plots/tDHxD/src/backends/pgfplotsx.jl:1351
  [8] prepare_output(plt::Plots.Plot{Plots.PGFPlotsXBackend})
    @ Plots ~/.julia/packages/Plots/tDHxD/src/plot.jl:257
  [9] display(#unused#::Plots.PlotsDisplay, plt::Plots.Plot{Plots.PGFPlotsXBackend})
    @ Plots ~/.julia/packages/Plots/tDHxD/src/output.jl:168
 [10] display(x::Any)
    @ Base.Multimedia ./multimedia.jl:328
 [11] #invokelatest#2
    @ ./essentials.jl:729 [inlined]
 [12] invokelatest
    @ ./essentials.jl:726 [inlined]
 [13] print_response(errio::IO, response::Any, show_value::Bool, have_color::Bool, specialdisplay::Union{Nothing, AbstractDisplay})
    @ REPL /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/REPL/src/REPL.jl:296
 [14] (::REPL.var"#45#46"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
    @ REPL /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/REPL/src/REPL.jl:278
 [15] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/REPL/src/REPL.jl:521
 [16] print_response(repl::REPL.AbstractREPL, response::Any, show_value::Bool, have_color::Bool)
    @ REPL /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/REPL/src/REPL.jl:276
 [17] (::REPL.var"#do_respond#66"{Bool, Bool, REPL.var"#77#87"{REPL.LineEditREPL, REPL.REPLHistoryProvider}, REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::Any, ok::Bool)
    @ REPL /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/REPL/src/REPL.jl:857
 [18] #invokelatest#2
    @ ./essentials.jl:729 [inlined]
 [19] invokelatest
    @ ./essentials.jl:726 [inlined]
 [20] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/REPL/src/LineEdit.jl:2510
 [21] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/REPL/src/REPL.jl:1248
 [22] (::REPL.var"#49#54"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL ./task.jl:484

答案1

得分: 0

这是一个最近修复的错误。尝试更新 Plots。应该可以在 v1.38.12 版本中工作。

英文:

It’s a bug that was recently fixed. Try updating Plots. It should work using v1.38.12.

huangapple
  • 本文由 发表于 2023年5月14日 02:38:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/76244347.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定