Skip to content

Commit

Permalink
Merge 9960d63 into 91fb468
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHBrock committed May 5, 2016
2 parents 91fb468 + 9960d63 commit 3d042d8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/statistics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,14 @@ function apply_statistic(stat::BarStatistic,
end

values = getfield(aes, var)
if isempty(getfield(aes, var))
setfield!(aes, minvar, Float64[1.0])
setfield!(aes, maxvar, Float64[1.0])
setfield!(aes, var, Float64[1.0])
setfield!(aes, othervar, Float64[0.0])
return
end

iscontinuous = haskey(scales, var) && isa(scales[var], Scale.ContinuousScale)
minvals, maxvals = barminmax(values, iscontinuous)

Expand Down
6 changes: 5 additions & 1 deletion test/subplot_categorical_bar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ plot(xgroup=["A", "A", "B", "B"],
y=rand(4),
Geom.subplot_grid(Geom.bar))


plot(x=rand(3),
y=rand(3),
xgroup=["A", "A", "B"],
ygroup=["X", "Y", "Y"],
Geom.subplot_grid(Geom.bar))

0 comments on commit 3d042d8

Please sign in to comment.