You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've documented the issue on this SO post for posterity but paste here also.
Thanks in advance and thanks for working on this! It's a very cool idea.
post:
I am passing a "dict-of-counts" style dataframe to Gadfly to make a barplot. The output is as expected when I use the vertical orientation, but it breaks when I use horizontal. Am I misunderstanding something or should I file a quick issue report? Thanks!
using Gadfly
using DataFrames
import Cairo, Fontconfig
df = DataFrame(group = ["A", "B", "C", "D"], count = [5,10,25,15])
vertPlot = plot(df, x = :group, y = :count, Geom.bar(orientation = :vertical))
horiPlot = plot(df, x = :group, y = :count, Geom.bar(orientation = :horizontal))
plot(df, x = :group, y = :count, Geom.bar(orientation = :vertical)) |> SVG("vertical.svg") # fine
plot(df, x = :group, y = :count, Geom.bar(orientation = :horizontal)) |> SVG("horizontal.svg") # RIP
The stack trace:
[thadryan@leon Test]
~:) julia ErrorInPlotWhenHorizonatal.jl
ERROR: LoadError: MethodError: no method matching zero(::Type{String})
Closest candidates are:
zero(::Type{Missing}) at missing.jl:103
zero(::Type{Pkg.Resolve.FieldValue}) at /build/julia/src/julia-1.5.4/usr/share/julia/stdlib/v1.5/Pkg/src/Resolve/fieldvalues.jl:38
zero(::Type{Pkg.Resolve.VersionWeight}) at /build/julia/src/julia-1.5.4/usr/share/julia/stdlib/v1.5/Pkg/src/Resolve/versionweights.jl:15
...
Stacktrace:
[1] apply_statistic(::Gadfly.Stat.BarStatistic, ::Dict{Symbol,Gadfly.ScaleElement}, ::Gadfly.Coord.Cartesian, ::Gadfly.Aesthetics) at /home/thadryan/.julia/packages/Gadfly/nN3lf/src/statistics.jl:239
[2] apply_statistics(::Array{Gadfly.StatisticElement,1}, ::Dict{Symbol,Gadfly.ScaleElement}, ::Gadfly.Coord.Cartesian, ::Gadfly.Aesthetics) at /home/thadryan/.julia/packages/Gadfly/nN3lf/src/statistics.jl:33
[3] render_prepare(::Plot) at /home/thadryan/.julia/packages/Gadfly/nN3lf/src/Gadfly.jl:680
[4] render(::Plot) at /home/thadryan/.julia/packages/Gadfly/nN3lf/src/Gadfly.jl:740
[5] draw at /home/thadryan/.julia/packages/Gadfly/nN3lf/src/Gadfly.jl:847 [inlined]
[6] SVG at /home/thadryan/.julia/packages/Compose/5GmGj/src/svg.jl:286 [inlined]
[7] |>(::Plot, ::SVG) at ./operators.jl:834
[8] top-level scope at /home/thadryan/Workspace/Test/ErrorInPlotWhenHorizonatal.jl:12
in expression starting at /home/thadryan/Workspace/Test/ErrorInPlotWhenHorizonatal.jl:12
My instinct is that it's expecting to count something, not have a number given to it but I'm not sure I'm not familiar with the inner workings of Gadfly.
Version info:
Julia: 1.5.4 (2021-03-11)
julia> Pkg.status("Gadfly")
Status `~/.julia/environments/v1.5/Project.toml`
[c91e804a] Gadfly v1.3.2
julia> Pkg.status("DataFrames")
Status `~/.julia/environments/v1.5/Project.toml`
[a93c6f00] DataFrames v0.22.5
julia> Pkg.status("Cairo")
Status `~/.julia/environments/v1.5/Project.toml`
[159f3aea] Cairo v1.0.5
julia> Pkg.status("Fontconfig")
Status `~/.julia/environments/v1.5/Project.toml`
[186bb1d3] Fontconfig v0.4.0
The text was updated successfully, but these errors were encountered:
Thanks, I've got what I'm looking for! I assume it would be like coord_flip() - I'll change the title of the SO post so it will be more discover-able for the next confused R user. Might be worth considering a specific error message for this at some point.
I've documented the issue on this SO post for posterity but paste here also.
Thanks in advance and thanks for working on this! It's a very cool idea.
post:
I am passing a "dict-of-counts" style dataframe to Gadfly to make a barplot. The output is as expected when I use the vertical orientation, but it breaks when I use horizontal. Am I misunderstanding something or should I file a quick issue report? Thanks!
The stack trace:
My instinct is that it's expecting to count something, not have a number given to it but I'm not sure I'm not familiar with the inner workings of Gadfly.
Version info:
Julia: 1.5.4 (2021-03-11)
The text was updated successfully, but these errors were encountered: