Skip to content

Commit 2358184

Browse files
committed
Highlight the correct bins in histograms
See JuliaCI#217 (comment)
1 parent 1497b72 commit 2358184

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/trials.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,11 +422,11 @@ function Base.show(io::IO, ::MIME"text/plain", t::Trial)
422422
# Histogram
423423

424424
histquantile = 0.99
425+
# The height and width of the printed histogram in characters.
425426
histheight = 2
426427
histwidth = 42 + lmaxtimewidth + rmaxtimewidth
427428

428429
histtimes = t.times[1:round(Int, histquantile*end)]
429-
# 47 = the 'base' width such that the histogram doesn't go past the statistics text
430430
bins, logbins = bindata(histtimes, histwidth - 1), false
431431
append!(bins, [1, floor((1-histquantile) * length(t.times))])
432432
# if median size of (bins with >10% average data/bin) is less than 5% of max bin size, log the bin sizes
@@ -438,8 +438,8 @@ function Base.show(io::IO, ::MIME"text/plain", t::Trial)
438438
maxbin = maximum(bins)
439439

440440
delta1 = (histtimes[end] - histtimes[1]) / (histwidth - 1)
441-
medpos = 1 + round(Int, (histtimes[length(histtimes) ÷ 2] - histtimes[1]) / delta1)
442-
avgpos = 1 + round(Int, (mean(histtimes) - histtimes[1]) / delta1)
441+
medpos = 1 + round(Int, (histtimes[length(t.times) ÷ 2] - histtimes[1]) / delta1)
442+
avgpos = 1 + round(Int, (mean(t.times) - histtimes[1]) / delta1)
443443

444444
print(io, "\n")
445445
for histrow in eachrow(hist)

0 commit comments

Comments
 (0)