Hi-
I would like to pass a variable to the keyword group in StatsPlots
, but I receive an error. Here is a simple example:
using DataFrames,StatsPlots
df = DataFrame(a=rand(100),b=rand(100),c=rand(1:2,100),d=rand(1:2,100))
group = (:c,:d)
for c in (:a,:b)
p = @df df histogram(cols(c),group=cols(group),layout=(2,2))
display(p)
end
Error:
MethodError: no method matching extractGroupArgs(::Array{Int64,2}, ::Array{Float64,1})
Closest candidates are:
extractGroupArgs(!Matched::AbstractArray{T,1} where T, ::Any...; legendEntry) at /home/dfish/.julia/packages/Plots/oiirH/src/args.jl:1078
extractGroupArgs(!Matched::Tuple, ::Any...) at /home/dfish/.julia/packages/Plots/oiirH/src/args.jl:1091
extractGroupArgs(!Matched::NamedTuple, ::Any...) at /home/dfish/.julia/packages/Plots/oiirH/src/args.jl:1101
I also tried group=group
and group = cols.(group)
without success.