Skip to content

Commit

Permalink
Merge pull request #874 from tlnagy/pull-request/e5ea6fc4
Browse files Browse the repository at this point in the history
modify bar handling to be more like other geometries
  • Loading branch information
shashi committed Aug 22, 2016
2 parents a410877 + e5ea6fc commit 4a36837
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
18 changes: 12 additions & 6 deletions src/geom/bar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,22 @@ immutable BarGeometry <: Gadfly.GeometryElement
default_statistic::Gadfly.StatisticElement

tag::Symbol
end

function BarGeometry(; position::Symbol=:stack,
orientation::Symbol=:vertical,
tag::Symbol=empty_tag)
new(position, orientation, Gadfly.Stat.bar(position=position,
orientation = orientation), tag)
end

function bar(; position::Symbol=:stack, orientation::Symbol=:vertical,
tag::Symbol=empty_tag)
return BarGeometry(
position, orientation,
Gadfly.Stat.bar(position=position, orientation=orientation), tag)
function BarGeometry(position::Symbol, orientation::Symbol,
default_statistic::Gadfly.StatisticElement,
tag::Symbol)
new(position, orientation, default_statistic, tag)
end
end

const bar = BarGeometry

function histogram(; position=:stack, bincount=nothing,
minbincount=3, maxbincount=150,
Expand Down
4 changes: 4 additions & 0 deletions test/issue871.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
using Gadfly

# check for method ambiguity using Geom.bar, #871
plot(x=1:10, y=1:10, Geom.bar, Guide.xlabel("foo"), Guide.ylabel("bar"))
5 changes: 2 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ tests = [
("auto_enumerate", 6inch, 3inch),
("coord_limits", 6inch, 6inch),
("rug", 6inch, 3inch),
("beeswarm", 6inch, 3inch)
("beeswarm", 6inch, 3inch),
("issue871", 6inch, 3inch)
]


Expand Down Expand Up @@ -185,5 +186,3 @@ run_tests("output/test.html")
#@time run_tests("output/test.html")
#@profile run_tests("output/test.html")
#Profile.print()


0 comments on commit 4a36837

Please sign in to comment.