From 73ffcb9bc1893079365563ee2f6204d78dbaaebc Mon Sep 17 00:00:00 2001 From: Thomas Breloff Date: Wed, 22 Jun 2016 13:20:09 -0400 Subject: [PATCH] changed convertToAnyVector AMat so that all matrices use the version previously for numbers; violin cleanup --- src/recipes.jl | 14 -------------- src/series_args.jl | 11 +---------- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/src/recipes.jl b/src/recipes.jl index 33c15701..82f02f37 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -752,21 +752,9 @@ end @recipe function f(::Type{Val{:violin}}, x, y, z; trim=true) delete!(d, :trim) - - # create a list of shapes, where each shape is a single boxplot - # shapes = Shape[] xsegs, ysegs = Segments(), Segments() - # groupby = extractGroupArgs(x) glabels = sort(collect(unique(x))) - - # for (i, glabel) in enumerate(groupby.groupLabels) for glabel in glabels - # get the edges and widths - # gids = groupby.groupIds[i] - # y = eltype(y)[yi for (i,yi) in e] - # y = y[filter(i -> cycle(x,i) == glabel, 1:length(y))] - - # y = d[:y][groupby.groupIds[i]] widths, centers = violin_coords(y[filter(i -> cycle(x,i) == glabel, 1:length(y))], trim=trim) isempty(widths) && continue @@ -777,14 +765,12 @@ end xcenter = discrete_value!(d[:subplot][:xaxis], glabel)[1] xcoords = vcat(widths, -reverse(widths)) + xcenter ycoords = vcat(centers, reverse(centers)) - # push!(shapes, Shape(xcoords, ycoords)) push!(xsegs, xcoords) push!(ysegs, ycoords) end seriestype := :shape - # d[:x], d[:y] = shape_coords(shapes) x := xsegs.pts y := ysegs.pts () diff --git a/src/series_args.jl b/src/series_args.jl index 4cf070e5..f822c918 100644 --- a/src/series_args.jl +++ b/src/series_args.jl @@ -21,8 +21,7 @@ convertToAnyVector{T<:Number}(v::AVec{T}, d::KW) = Any[v], nothing # string vector convertToAnyVector{T<:@compat(AbstractString)}(v::AVec{T}, d::KW) = Any[v], nothing -# numeric matrix -function convertToAnyVector{T<:Number}(v::AMat{T}, d::KW) +function convertToAnyVector(v::AMat, d::KW) if all3D(d) Any[Surface(v)] else @@ -30,14 +29,6 @@ function convertToAnyVector{T<:Number}(v::AMat{T}, d::KW) end, nothing end -# other matrix... vector of columns -function convertToAnyVector(m::AMat, d::KW) - Any[begin - v = vec(m[:,i]) - length(v) == 1 ? v[1] : v - end for i=1:size(m,2)], nothing -end - # function convertToAnyVector(f::Function, d::KW) = Any[f], nothing