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

ticklabes are not working through Plots.jl with a :log scale #298

Closed
IljaK91 opened this issue Jul 6, 2022 · 1 comment
Closed

ticklabes are not working through Plots.jl with a :log scale #298

IljaK91 opened this issue Jul 6, 2022 · 1 comment
Labels

Comments

@IljaK91
Copy link

IljaK91 commented Jul 6, 2022

using Plots
pgfplotsx()
plot(1:10, 1:10, yaxis = :log)
yticks!(1:10, ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"])
# This throws an error
gr()
plot(1:10, 1:10, yaxis = :log)
yticks!(1:10, ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"])
# This works

With the error message

Display Error: ERROR: BoundsError: attempt to access 1-element Vector{SubString{String}} at index [2]
Stacktrace:
  [1] getindex
    @ .\array.jl:861 [inlined]
  [2] indexed_iterate
    @ .\tuple.jl:90 [inlined]
  [3] wrap_power_labels(ticks::Vector{String})
    @ Plots C:\Users\kantorov\.julia\packages\Plots\E2187\src\backends\pgfplotsx.jl:1236
  [4] pgfx_axis!(opt::PGFPlotsX.Options, sp::Plots.Subplot{Plots.PGFPlotsXBackend}, letter::Symbol)
    @ Plots C:\Users\kantorov\.julia\packages\Plots\E2187\src\backends\pgfplotsx.jl:1348
  [5] (::Plots.PGFPlotsXPlot)(plt::Plots.Plot{Plots.PGFPlotsXBackend})
    @ Plots C:\Users\kantorov\.julia\packages\Plots\E2187\src\backends\pgfplotsx.jl:167
  [6] _update_plot_object(plt::Plots.Plot{Plots.PGFPlotsXBackend})
    @ Plots C:\Users\kantorov\.julia\packages\Plots\E2187\src\backends\pgfplotsx.jl:1478
  [7] prepare_output(plt::Plots.Plot{Plots.PGFPlotsXBackend})
    @ Plots C:\Users\kantorov\.julia\packages\Plots\E2187\src\plot.jl:247
  [8] show(io::Base64.Base64EncodePipe, m::MIME{Symbol("image/png")}, plt::Plots.Plot{Plots.PGFPlotsXBackend})
    @ Plots C:\Users\kantorov\.julia\packages\Plots\E2187\src\output.jl:201
  [9] base64encode(::Function, ::MIME{Symbol("image/png")}, ::Vararg{Any}; context::Nothing)
    @ Base64 C:\Users\kantorov\.julia\juliaup\julia-1.7.3+0~x64\share\julia\stdlib\v1.7\Base64\src\encode.jl:209
 [10] _binstringmime
    @ C:\Users\kantorov\.julia\juliaup\julia-1.7.3+0~x64\share\julia\stdlib\v1.7\Base64\src\Base64.jl:46 [inlined]
 [11] stringmime(m::MIME{Symbol("image/png")}, x::Plots.Plot{Plots.PGFPlotsXBackend}; context::Nothing)
    @ Base64 C:\Users\kantorov\.julia\juliaup\julia-1.7.3+0~x64\share\julia\stdlib\v1.7\Base64\src\Base64.jl:43
 [12] stringmime
    @ C:\Users\kantorov\.julia\juliaup\julia-1.7.3+0~x64\share\julia\stdlib\v1.7\Base64\src\Base64.jl:43 [inlined]
 [13] display(d::VSCodeServer.InlineDisplay, m::MIME{Symbol("image/png")}, x::Plots.Plot{Plots.PGFPlotsXBackend})
    @ VSCodeServer c:\Users\kantorov\.vscode\extensions\julialang.language-julia-1.6.24\scripts\packages\VSCodeServer\src\display.jl:57
 [14] display(d::VSCodeServer.InlineDisplay, mime::String, x::Any)
    @ Base.Multimedia .\multimedia.jl:216
 [15] display(d::VSCodeServer.InlineDisplay, x::Plots.Plot{Plots.PGFPlotsXBackend})
    @ VSCodeServer c:\Users\kantorov\.vscode\extensions\julialang.language-julia-1.6.24\scripts\packages\VSCodeServer\src\display.jl:165
 [16] #invokelatest#2
    @ .\essentials.jl:716 [inlined]
 [17] invokelatest
    @ .\essentials.jl:714 [inlined]
 [18] (::VSCodeServer.var"#65#69"{Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer c:\Users\kantorov\.vscode\extensions\julialang.language-julia-1.6.24\scripts\packages\VSCodeServer\src\eval.jl:184
 [19] withpath(f::VSCodeServer.var"#65#69"{Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams}, path::String)
    @ VSCodeServer c:\Users\kantorov\.vscode\extensions\julialang.language-julia-1.6.24\scripts\packages\VSCodeServer\src\repl.jl:184
 [20] (::VSCodeServer.var"#64#68"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer c:\Users\kantorov\.vscode\extensions\julialang.language-julia-1.6.24\scripts\packages\VSCodeServer\src\eval.jl:153
 [21] hideprompt(f::VSCodeServer.var"#64#68"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})
    @ VSCodeServer c:\Users\kantorov\.vscode\extensions\julialang.language-julia-1.6.24\scripts\packages\VSCodeServer\src\repl.jl:36
 [22] (::VSCodeServer.var"#63#67"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer c:\Users\kantorov\.vscode\extensions\julialang.language-julia-1.6.24\scripts\packages\VSCodeServer\src\eval.jl:124
 [23] with_logstate(f::Function, logstate::Any)
    @ Base.CoreLogging .\logging.jl:511
 [24] with_logger
    @ .\logging.jl:623 [inlined]
 [25] (::VSCodeServer.var"#62#66"{VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer c:\Users\kantorov\.vscode\extensions\julialang.language-julia-1.6.24\scripts\packages\VSCodeServer\src\eval.jl:201
 [26] #invokelatest#2
    @ .\essentials.jl:716 [inlined]
 [27] invokelatest(::Any)
    @ Base .\essentials.jl:714
 [28] macro expansion
    @ c:\Users\kantorov\.vscode\extensions\julialang.language-julia-1.6.24\scripts\packages\VSCodeServer\src\eval.jl:34 [inlined]
 [29] (::VSCodeServer.var"#60#61")()
    @ VSCodeServer .\task.jl:429
status Plots PGFPlotsX GR
      Status `C:\Users\kantorov\.julia\environments\v1.7\Project.toml`
  [28b8d3ca] GR v0.64.4
  [8314cec4] PGFPlotsX v1.5.0
  [91a5bcdd] Plots v1.31.1
@KristofferC KristofferC added the bug label Jul 6, 2022
@t-bltg
Copy link
Contributor

t-bltg commented Apr 16, 2023

This should be reported to Plots.jl as this appears to be a Plots bug.

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

No branches or pull requests

3 participants