Skip to content

Commit

Permalink
Merge pull request JuliaPlots#86 from mkborregaard/fix-marginalhist
Browse files Browse the repository at this point in the history
fix marginalhist
  • Loading branch information
mkborregaard authored Sep 5, 2017
2 parents c343620 + a62f545 commit c429795
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/marginalhist.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

@recipe function f(::Type{Val{:marginalhist}}, plt::AbstractPlot; density = false)
x, y = d[:x], d[:y]
bns = get(d, :bins, :auto)
edges1, edges2 = Plots._hist_edges((x,y), bns)

# set up the subplots
legend --> false
Expand All @@ -18,6 +20,7 @@
right_margin --> 0mm
top_margin --> 0mm
subplot := 2
bins := (edges1, edges2)
end

# these are common to both marginal histograms
Expand All @@ -34,16 +37,11 @@
seriestype := :histogram
end


bns = get(d, :bins, nothing)

# upper histogram
@series begin
subplot := 1
bottom_margin --> 0mm
if bns != nothing && length(bns) == 2
bins := bns[1]
end
bins := edges1
y := x
end

Expand All @@ -52,9 +50,7 @@
orientation := :h
subplot := 3
left_margin --> 0mm
if bns != nothing && length(bns) == 2
bins := bns[2]
end
bins := edges2
y := y
end
end
Expand Down

0 comments on commit c429795

Please sign in to comment.