Create histogram with missing values

The definition of Plots recipes can help to handle histograms with missing values, especially the type recipes:

using DataFrames, Plots

df = DataFrame(a = [randn(99); missing; randn(99) .+ 2; missing; randn(99) .+ 4])

@recipe function f(v::Vector{Union{Missing, Float64}})
    seriestype --> :hist
    y = filter(!ismissing, v)
    1:length(y), y
end

histogram(df.a)   # it should now work for Vectors with missings
1 Like