KristofferC / PGFPlotsX.jl

Plots in Julia using the PGFPlots LaTeX package
Other
301 stars 40 forks source link

Text line contains invalid character #266

Closed IljaK91 closed 3 years ago

IljaK91 commented 3 years ago

I use an up-to-date MikTeX installation. Do you know why plotting with pgfplotsx might fail? I get the following error message:

julia> using Plots
julia> pgfplotsx()
julia> plot(1:5, 1:5)
! Text line contains an invalid character.
l.35 ...ck={{1.0,2.0,3.0,4.0,5.0}}, xticklabels={{$�
                                                  $,$�$,$�$,$�$,$�$}}, xtick...
Error showing value of type Plots.Plot{Plots.PGFPlotsXBackend}:
ERROR: The latex command `lualatex jl_juBL5S6nu6.tex` failed
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:33
  [2] savepdf(filename::String, td::PGFPlotsX.TikzDocument; latex_engine::PGFPlotsX.LaTeXEngine, buildflags::Vector{String}, run_count::Int64, tmp::String)
    @ PGFPlotsX C:\Users\Ilja\.julia\packages\PGFPlotsX\qM8D5\src\tikzdocument.jl:197
  [3] savesvg(filename::String, td::PGFPlotsX.TikzDocument; latex_engine::PGFPlotsX.LaTeXEngine, buildflags::Vector{String}, keep_pdf::Bool)
    @ PGFPlotsX C:\Users\Ilja\.julia\packages\PGFPlotsX\qM8D5\src\tikzdocument.jl:267
  [4] save(filename::String, td::PGFPlotsX.TikzDocument; include_preamble::Bool, latex_engine::PGFPlotsX.LaTeXEngine, buildflags::Vector{String}, dpi::Int64, showing_ide::Bool)
    @ PGFPlotsX C:\Users\Ilja\.julia\packages\PGFPlotsX\qM8D5\src\tikzdocument.jl:84
  [5] show(f::IOBuffer, #unused#::MIME{Symbol("image/svg+xml")}, td::PGFPlotsX.TikzDocument)
    @ PGFPlotsX C:\Users\Ilja\.julia\packages\PGFPlotsX\qM8D5\src\tikzdocument.jl:289
  [6] _show(io::IOBuffer, mime::MIME{Symbol("image/svg+xml")}, plt::Plots.Plot{Plots.PGFPlotsXBackend})
    @ Plots C:\Users\Ilja\.julia\packages\Plots\lzHOt\src\backends\pgfplotsx.jl:1408
  [7] display(d::VSCodeServer.InlineDisplay, m::MIME{Symbol("image/svg+xml")}, x::Plots.Plot{Plots.PGFPlotsXBackend})
    @ VSCodeServer c:\Users\Ilja\.vscode\extensions\julialang.language-julia-insider-1.1.38\scripts\packages\VSCodeServer\src\display.jl:0
  [8] display(d::VSCodeServer.InlineDisplay, mime::String, x::Any)
    @ Base.Multimedia .\multimedia.jl:216
  [9] display(d::VSCodeServer.InlineDisplay, x::Plots.Plot{Plots.PGFPlotsXBackend})
    @ VSCodeServer c:\Users\Ilja\.vscode\extensions\julialang.language-julia-insider-1.1.38\scripts\packages\VSCodeServer\src\display.jl:108
 [10] display(x::Any)
    @ Base.Multimedia .\multimedia.jl:328
 [11] #invokelatest#2
    @ .\essentials.jl:708 [inlined]
 [12] invokelatest
    @ .\essentials.jl:706 [inlined]
 [13] print_response(errio::IO, response::Any, show_value::Bool, have_color::Bool, specialdisplay::Union{Nothing, AbstractDisplay})
    @ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:247
 [14] (::REPL.var"#40#41"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
    @ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:231
 [15] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:462
 [16] print_response(repl::REPL.AbstractREPL, response::Any, show_value::Bool, have_color::Bool)
    @ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:229
 [17] (::REPL.var"#do_respond#61"{Bool, Bool, REPL.var"#72#82"{REPL.LineEditREPL, REPL.REPLHistoryProvider}, REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::Any, ok::Bool)
    @ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:798
 [18] #invokelatest#2
    @ .\essentials.jl:708 [inlined]
 [19] invokelatest
    @ .\essentials.jl:706 [inlined]
 [20] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\LineEdit.jl:2441
 [21] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:1126
 [22] (::REPL.var"#44#49"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL .\task.jl:411
julia> versioninfo()
Julia Version 1.6.1
Commit 6aaedecc44 (2021-04-23 05:59 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, broadwell)
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 4
(@v1.6) pkg> status
      Status `C:\Users\Ilja\.julia\environments\v1.6\Project.toml`
  [70b36510] AutomaticDocstrings v1.0.1
  [6e4b80f9] BenchmarkTools v0.7.0
  [336ed68f] CSV v0.8.4
  [5d742f6a] CSVFiles v1.0.0
  [1375f997] CompEcon v0.4.0
  [8f4d0f93] Conda v1.5.2
  [a93c6f00] DataFrames v1.0.1
  [1313f7d8] DataFramesMeta v0.6.1
  [e7dc6d0d] DataValues v0.4.13
  [5721bf48] DataVoyager v1.0.1
  [31a5f54b] Debugger v0.6.7
  [31c24e10] Distributions v0.23.11
  [634d3b9d] DrWatson v2.0.2
  [d872a56f] ElectronDisplay v1.0.1
  [442a2c76] FastGaussQuadrature v0.4.7
  [26cc04aa] FiniteDifferences v0.12.3
  [f6369f11] ForwardDiff v0.10.18
  [38e38edf] GLM v1.4.2
  [28b8d3ca] GR v0.57.4
  [c91e804a] Gadfly v1.3.2
  [19dc6840] HCubature v1.5.0
  [7073ff75] IJulia v1.23.2
  [a98d9a8b] Interpolations v0.13.2
  [aa1ae85d] JuliaInterpreter v0.8.14
  [b964fa9f] LaTeXStrings v1.2.1
  [442fdcdd] Measures v0.3.1
  [2774e3e8] NLsolve v4.5.1
  [429524aa] Optim v1.3.0
  [8314cec4] PGFPlotsX v1.2.10
  [9b87118b] PackageCompiler v1.2.5
  [d96e819e] Parameters v0.12.2
  [f0f68f2c] PlotlyJS v0.14.1
  [91a5bcdd] Plots v1.13.2
  [08abe8d2] PrettyTables v1.0.1
  [c46f51b8] ProfileView v0.6.9
  [438e738f] PyCall v1.92.3
  [d330b81b] PyPlot v2.9.0
  [1fd47b50] QuadGK v2.4.1
  [fcd29c91] QuantEcon v0.16.2
  [1a8c2f83] Query v1.0.0
  [93e0c654] Reduce v1.2.10
  [295af30f] Revise v3.1.15
  [f2b01f46] Roots v1.0.9
  [efcf1570] Setfield v0.7.0
  [1463e38c] StatFiles v0.8.0
  [90137ffa] StaticArrays v1.1.2
  [2913bbd2] StatsBase v0.33.6
  [4c63d2b9] StatsFuns v0.9.8
  [3eaba693] StatsModels v0.6.22
  [f3b207a7] StatsPlots v0.14.20
  [24249f21] SymPy v1.0.43
  [0c5d862f] Symbolics v0.1.24
  [9e3dc215] TimeSeries v0.20.1
  [6385f0a0] WordCloud v0.6.7
  [fdbf4ff8] XLSX v0.7.6
  [c4c688b2] jlpkg v1.3.2
  [37e2e46d] LinearAlgebra
  [9a3f8284] Random
  [10745b16] Statistics
  [8dfed614] Test
KristofferC commented 3 years ago

My guess is that this is related to https://discourse.julialang.org/t/plotting-broken-gadfly-and-plots-backends-not-showing-axis-ticks-cant-plot-dataframes/60201.

Should be fixed after a Pkg.update. If not, Plots.jl is somehow producing a bad xticklabels entry.