Skip to content

Commit ba04afa

Browse files
committed
workaround for Plots.jl not setting the correct ylims on one of the heatmap marginals
1 parent 45f2341 commit ba04afa

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/viz/heatmap.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,15 @@ end
7171
link --> :x
7272
z = Float64.(o.counts)
7373
z[z .== 0] .= NaN
74+
xlims = extrema(o.xedges)
75+
ylims = extrema(o.yedges)
7476
@series begin
7577
s = marginals ? 3 : 1
7678
subplot --> s
7779
seriestype --> :heatmap
7880
legend --> false
81+
xlims --> xlims
82+
ylims --> ylims
7983
o.xedges, o.yedges, z'
8084
end
8185
if marginals
@@ -95,6 +99,7 @@ end
9599
linewidth --> 0
96100
line_alpha --> 0
97101
seriestype --> :bar
102+
xlims --> xlims
98103
o.xedges, vec(sum(o.counts, dims=2))
99104
end
100105
@series begin
@@ -104,6 +109,7 @@ end
104109
line_alpha --> 0
105110
orientation --> :h
106111
seriestype --> :bar
112+
ylims --> ylims
107113
o.yedges, vec(sum(o.counts, dims=1))
108114
end
109115
end

0 commit comments

Comments
 (0)