Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Issue when xticklabels has exponents #4308

Closed
tknopp opened this issue Aug 12, 2022 · 2 comments · Fixed by #4310
Closed

[BUG] Issue when xticklabels has exponents #4308

tknopp opened this issue Aug 12, 2022 · 2 comments · Fixed by #4310
Assignees
Labels

Comments

@tknopp
Copy link

tknopp commented Aug 12, 2022

I get the following error:

julia> using Plots

julia> pgfplotsx()
Plots.PGFPlotsXBackend()

julia> p=plot((1:1000).^2,(1:1000).^2, xscale=:log10)
! Missing $ inserted.
<inserted text> 
$
l.1043 \end{axis}
               
Error showing value of type Plots.Plot{Plots.PGFPlotsXBackend}:
ERROR: The latex command `lualatex jl_GYXGOa.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 ~/.julia/packages/PGFPlotsX/pUwhF/src/tikzdocument.jl:202
  [3] save(filename::String, td::PGFPlotsX.TikzDocument; include_preamble::Bool, latex_engine::PGFPlotsX.LaTeXEngine, buildflags::Vector{String}, dpi::Int64, showing_ide::Bool)
    @ PGFPlotsX ~/.julia/packages/PGFPlotsX/pUwhF/src/tikzdocument.jl:86
  [4] save(filename::String, td::PGFPlotsX.TikzDocument)
    @ PGFPlotsX ~/.julia/packages/PGFPlotsX/pUwhF/src/tikzdocument.jl:73
  [5] display(d::PGFPlotsX.PGFPlotsXDisplay, p::PGFPlotsX.TikzDocument)
    @ PGFPlotsX ~/.julia/packages/PGFPlotsX/pUwhF/src/tikzdocument.jl:356
  [6] _display(plt::Plots.Plot{Plots.PGFPlotsXBackend})
    @ Plots ~/.julia/packages/Plots/0MO2T/src/backends/pgfplotsx.jl:1384
  [7] display(#unused#::Plots.PlotsDisplay, plt::Plots.Plot{Plots.PGFPlotsXBackend})
    @ Plots ~/.julia/packages/Plots/0MO2T/src/output.jl:158
  [8] display(x::Any)
    @ Base.Multimedia ./multimedia.jl:328
  [9] #invokelatest#2
    @ ./essentials.jl:716 [inlined]
 [10] invokelatest
    @ ./essentials.jl:714 [inlined]
 [11] print_response(errio::IO, response::Any, show_value::Bool, have_color::Bool, specialdisplay::Union{Nothing, AbstractDisplay})
    @ REPL /opt/software/julia-1.7.2/share/julia/stdlib/v1.7/REPL/src/REPL.jl:293
 [12] (::REPL.var"#45#46"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
    @ REPL /opt/software/julia-1.7.2/share/julia/stdlib/v1.7/REPL/src/REPL.jl:277
 [13] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL /opt/software/julia-1.7.2/share/julia/stdlib/v1.7/REPL/src/REPL.jl:510
 [14] print_response(repl::REPL.AbstractREPL, response::Any, show_value::Bool, have_color::Bool)
    @ REPL /opt/software/julia-1.7.2/share/julia/stdlib/v1.7/REPL/src/REPL.jl:275
 [15] (::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 /opt/software/julia-1.7.2/share/julia/stdlib/v1.7/REPL/src/REPL.jl:846
 [16] #invokelatest#2
    @ ./essentials.jl:716 [inlined]
 [17] invokelatest
    @ ./essentials.jl:714 [inlined]
 [18] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit /opt/software/julia-1.7.2/share/julia/stdlib/v1.7/REPL/src/LineEdit.jl:2493
 [19] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL /opt/software/julia-1.7.2/share/julia/stdlib/v1.7/REPL/src/REPL.jl:1232
 [20] (::REPL.var"#49#54"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL ./task.jl:423

My versions are:

(@v1.7) pkg> st  --manifest Plots
      Status `~/.julia/environments/v1.7/Manifest.toml`
  [91a5bcdd] Plots v1.31.6

(@v1.7) pkg> st  --manifest PGFPlotsX
      Status `~/.julia/environments/v1.7/Manifest.toml`
  [8314cec4] PGFPlotsX v1.5.0

On version v1.31.4 the code works fine.

@t-bltg
Copy link
Member

t-bltg commented Aug 13, 2022

Sorry about that, I think it's related to the axis formatter change in #4262.
I should have released it as breaking, my bad.
Anyway, this is clearly a bug so working on it asap.

@tknopp
Copy link
Author

tknopp commented Aug 13, 2022

thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants