Skip to content

Commit 07a99e1

Browse files
committed
fix groupby with heatmap plot
1 parent ccc3d20 commit 07a99e1

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

src/OnlineStats.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ include("viz/khist.jl")
114114
include("viz/khist2d.jl")
115115
include("viz/partition.jl")
116116
include("viz/mosaicplot.jl")
117-
include("viz/recipes.jl")
118117
include("viz/heatmap.jl")
118+
include("viz/recipes.jl")
119119
include("viz/hexlattice.jl")
120120
include("viz/ash.jl")
121121
end

src/stats/histograms.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ counts(o::ExpandingHist) = o.counts
186186
edges(o::ExpandingHist) = o.edges
187187

188188
function _fit!(o::ExpandingHist, y)
189-
isfinite(y) || error("ExpandingHist requires finite values. Found $y.")
189+
isfinite(y) || error("ExpandingHist requires `isfinite` values. Found $y.")
190190
o.n += 1
191191

192192
# init

src/viz/recipes.jl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ end
7171
end
7272

7373
#-----------------------------------------------------------------------# GroupBy
74-
@recipe function f(o::GroupBy{<:Any, <:Any, <:Union{KHist, ExpandingHist, Hist}})
74+
@recipe function f(o::GroupBy{<:Any, <:Any, <:Union{KHist, ExpandingHist, Hist, HeatMap}})
7575
sort!(o.value)
7676
link --> :all
7777
for (k, v) in pairs(o.value)
@@ -81,6 +81,19 @@ end
8181
end
8282
end
8383
end
84+
@recipe function f(o::GroupBy{<:Any, <:Any, <:HeatMap})
85+
sort!(o.value)
86+
link --> :all
87+
layout --> length(o.value)
88+
for (i, (k, v)) in enumerate(pairs(o.value))
89+
@series begin
90+
subplot --> i
91+
marginals --> false
92+
title --> string(k)
93+
v
94+
end
95+
end
96+
end
8497
@recipe function f(o::GroupBy)
8598
sort!(o.value)
8699
link --> :all

0 commit comments

Comments
 (0)