Skip to content

Commit

Permalink
fix hist(..., gap = 0.1) (#3870)
Browse files Browse the repository at this point in the history
* gap

* add test

* Update examples2d.jl

---------

Co-authored-by: Simon <sdanisch@protonmail.com>
  • Loading branch information
cossio and SimonDanisch authored May 17, 2024
1 parent 179d8fc commit 4181ab6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ReferenceTests/src/tests/examples2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,12 @@ end
fig
end

@reference_test "hist(...; gap=0.1)" begin
fig = Figure(size = (400, 400))
hist(fig[1,1], RNG.randn(1000); gap=0.1)
fig
end

@reference_test "Stephist" begin
stephist(RNG.rand(10000))
current_figure()
Expand Down
2 changes: 2 additions & 0 deletions src/stats/hist.jl
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ Plot a histogram of `values`.
label_formatter = bar_label_formatter
"Set the direction of the bars."
direction = :y
"Gap between the bars (see barplot)."
gap = 0
end

function pick_hist_edges(vals, bins)
Expand Down

0 comments on commit 4181ab6

Please sign in to comment.