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

trying to use Stat.yticks causes MethodError #1616

Open
nsajko opened this issue Jun 14, 2023 · 0 comments
Open

trying to use Stat.yticks causes MethodError #1616

nsajko opened this issue Jun 14, 2023 · 0 comments

Comments

@nsajko
Copy link

nsajko commented Jun 14, 2023

xticks works fine:

julia> plot(
         y = [sind], xmin = [0.0], xmax = [29.0],
         Stat.xticks(coverage_weight = 7/8),
         Stat.func(), Geom.line(),
       )

Using yticks instead of xticks errors:

julia> plot(
         y = [sind], xmin = [0.0], xmax = [29.0],
         Stat.yticks(coverage_weight = 7/8),
         Stat.func(), Geom.line(),
       )
Error showing value of type Plot:
ERROR: MethodError: no method matching one(::Type{typeof(sind)})

Closest candidates are:
  one(::Type{Union{}}, ::Any...)
   @ Base number.jl:349
  one(::Type{Missing})
   @ Base missing.jl:104
  one(::Missing)
   @ Base missing.jl:101
  ...

Stacktrace:
  [1] oneunit(::Type{typeof(sind)})
    @ Base ./number.jl:372
  [2] optimize_ticks_typed(x_min::typeof(sind), x_max::typeof(sind), extend_ticks::Bool, Q::Vector{Tuple{Float64, Float64}}, k_min::Int64, k_max::Int64, k_ideal::Int64, granularity_weight::Float64, simplicity_weight::Float64, coverage_weight::Float64, niceness_weight::Float64, strict_span::Bool)
    @ Gadfly ~/.julia/packages/Gadfly/B5yQc/src/ticks.jl:72
  [3] optimize_ticks(x_min::typeof(sind), x_max::typeof(sind); extend_ticks::Bool, Q::Vector{Tuple{Float64, Float64}}, k_min::Int64, k_max::Int64, k_ideal::Int64, granularity_weight::Float64, simplicity_weight::Float64, coverage_weight::Float64, niceness_weight::Float64, strict_span::Bool)
    @ Gadfly ~/.julia/packages/Gadfly/B5yQc/src/ticks.jl:61
  [4] apply_statistic(stat::Gadfly.Stat.TickStatistic, scales::Dict{Symbol, Gadfly.ScaleElement}, coord::Gadfly.Coord.Cartesian, aes::Gadfly.Aesthetics)
    @ Gadfly.Stat ~/.julia/packages/Gadfly/B5yQc/src/statistics.jl:964
  [5] apply_statistics(stats::Vector{Gadfly.StatisticElement}, scales::Dict{Symbol, Gadfly.ScaleElement}, coord::Gadfly.Coord.Cartesian, aes::Gadfly.Aesthetics)
    @ Gadfly.Stat ~/.julia/packages/Gadfly/B5yQc/src/statistics.jl:33
  [6] render_prepare(plot::Plot)
    @ Gadfly ~/.julia/packages/Gadfly/B5yQc/src/Gadfly.jl:676
  [7] render(plot::Plot)
    @ Gadfly ~/.julia/packages/Gadfly/B5yQc/src/Gadfly.jl:736
  [8] draw(backend::SVG, p::Plot)
    @ Gadfly ~/.julia/packages/Gadfly/B5yQc/src/Gadfly.jl:843 [inlined]
  [9] show(io::IOBuffer, m::MIME{Symbol("text/html")}, p::Plot)
    @ Gadfly ~/.julia/packages/Gadfly/B5yQc/src/Gadfly.jl:933
 [10] show(io::IOBuffer, m::String, x::Plot)
    @ Base.Multimedia ./multimedia.jl:123
 [11] show(io::IOBuffer, ::MIME{Symbol("juliavscode/html")}, p::Plot)
    @ Gadfly ~/.julia/packages/Gadfly/B5yQc/src/Gadfly.jl:938 [inlined]
 [12] __binrepr(m::MIME{Symbol("juliavscode/html")}, x::Plot, context::Nothing)
    @ Base.Multimedia ./multimedia.jl:171
 [13] _textrepr(m::MIME{Symbol("juliavscode/html")}, x::Plot, context::Nothing)
    @ Base.Multimedia ./multimedia.jl:163 [inlined]
 [14] repr(m::MIME{Symbol("juliavscode/html")}, x::Plot; context::Nothing)
    @ Base.Multimedia ./multimedia.jl:159 [inlined]
 [15] display(d::VSCodeServer.InlineDisplay, m::MIME{Symbol("juliavscode/html")}, x::Plot)
    @ VSCodeServer ~/.vscode-oss/extensions/julialang.language-julia-1.47.2-universal/scripts/packages/VSCodeServer/src/display.jl:57
 [16] display(d::VSCodeServer.InlineDisplay, mime::String, x::Any)
    @ Base.Multimedia ./multimedia.jl:228
 [17] display(d::VSCodeServer.InlineDisplay, x::Plot)
    @ VSCodeServer ~/.vscode-oss/extensions/julialang.language-julia-1.47.2-universal/scripts/packages/VSCodeServer/src/display.jl:166
 [18] display(x::Any)
    @ Base.Multimedia ./multimedia.jl:340
 [19] invokelatest(::typeof(Base.display_error), ::IO, ::Base.ExceptionStack; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, @NamedTuple{}})
    @ Base ./essentials.jl:864 [inlined]
 [20] invokelatest(::typeof(Base.display_error), ::IO, ::Any)
    @ Base ./essentials.jl:861 [inlined]
 [21] print_response(errio::IO, response::Any, show_value::Bool, have_color::Bool, specialdisplay::Union{Nothing, AbstractDisplay})
    @ REPL ~/tmp/julia/usr/share/julia/stdlib/v1.10/REPL/src/REPL.jl:302
 [22] (::REPL.var"#57#58"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
    @ REPL ~/tmp/julia/usr/share/julia/stdlib/v1.10/REPL/src/REPL.jl:284
 [23] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL ~/tmp/julia/usr/share/julia/stdlib/v1.10/REPL/src/REPL.jl:554
 [24] print_response(repl::REPL.AbstractREPL, response::Any, show_value::Bool, have_color::Bool)
    @ REPL ~/tmp/julia/usr/share/julia/stdlib/v1.10/REPL/src/REPL.jl:282
 [25] (::REPL.var"#do_respond#80"{Bool, Bool, REPL.var"#93#103"{REPL.LineEditREPL, REPL.REPLHistoryProvider}, REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::Any, ok::Bool)
    @ REPL ~/tmp/julia/usr/share/julia/stdlib/v1.10/REPL/src/REPL.jl:896
 [26] (::VSCodeServer.var"#98#101"{REPL.var"#do_respond#80"{Bool, Bool, REPL.var"#93#103"{REPL.LineEditREPL, REPL.REPLHistoryProvider}, REPL.LineEditREPL, REPL.LineEdit.Prompt}})(mi::REPL.LineEdit.MIState, buf::IOBuffer, ok::Bool)
    @ VSCodeServer ~/.vscode-oss/extensions/julialang.language-julia-1.47.2-universal/scripts/packages/VSCodeServer/src/repl.jl:122
 [27] invokelatest(::Any, ::REPL.LineEdit.MIState, ::IOBuffer, ::Bool; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, @NamedTuple{}})
    @ Base ./essentials.jl:864 [inlined]
 [28] invokelatest(::Any, ::REPL.LineEdit.MIState, ::IOBuffer, ::Bool)
    @ Base ./essentials.jl:861 [inlined]
 [29] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit ~/tmp/julia/usr/share/julia/stdlib/v1.10/REPL/src/LineEdit.jl:2656
 [30] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL ~/tmp/julia/usr/share/julia/stdlib/v1.10/REPL/src/REPL.jl:1297
 [31] (::REPL.var"#62#68"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL ~/tmp/julia/usr/share/julia/stdlib/v1.10/REPL/src/REPL.jl:373
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant