[julia-users] Layered subplot does not work with categorical variables
Hi all- I'm having trouble creating a subplot with multiple layers when the variables are categorical. Here is a stripped down version of my code. df = DataFrame(Condition = repeat(["Condition 1","Condition 2"], inner = 3), Block = repeat(["Block 1","Block 2", "Block 3"],outer = 2),y1 = rand(6), y2 = rand(6)) plot( Geom.subplot_grid( layer(df,x = :Block,y = :y1,xgroup = :Condition, Geom.line, Theme(default_color=colorant"red")), layer(df,x = :Block,y = :y2,xgroup = :Condition, Geom.line, Theme(default_color=colorant"blue" This generates the following error: ethodError: no method matching isfinite(::String) Closest candidates are: isfinite(!Matched::Float16) at float16.jl:119 isfinite(!Matched::BigFloat) at mpfr.jl:799 isfinite(!Matched::DataArrays.NAtype) at /home/dfish/.julia/v0.5/DataArrays/src/predicates.jl:9 However, if I use Block repeat([1,2,3],outer = 2), the code works. Is there any way around this? Thanks, Chris
[julia-users] Layered subplot does not work with categorical variables
Hi all- I'm having trouble creating a subplot with multiple layers when the variables are categorical. Here is a stripped down version of my code. df = DataFrame(Condition = repeat(["Condition 1","Condition 2"], inner = 3), Block = repeat(["Block 1","Block 2", "Block 3"],outer = 2),y1 = rand(6), y2 = rand(6)) plot( Geom.subplot_grid( layer(df,x = :Block,y = :y1,xgroup = :Condition, Geom.line, Theme(default_color=colorant"red")), layer(df,x = :Block,y = :y2,xgroup = :Condition, Geom.line, Theme(default_color=colorant"blue" This generates the following error: ethodError: no method matching isfinite(::String) Closest candidates are: isfinite(!Matched::Float16) at float16.jl:119 isfinite(!Matched::BigFloat) at mpfr.jl:799 isfinite(!Matched::DataArrays.NAtype) at /home/dfish/.julia/v0.5/DataArrays/src/predicates.jl:9 However, if I use Block repeat([1,2,3],outer = 2), the code works. Is there any way around this? Thanks, Chris