Hi,
I’d like to plot a boxplot with different number of data for each label.
For example,
using StatsPlots
labels = ["hi", "hello"]
data = [1.0 missing 3.0; 4.0 5.0 6.0]
boxplot(labels, data)
results in the error:
julia> boxplot(labels, data)
ERROR: ArgumentError: quantiles are undefined in presence of NaNs or missing values
Stacktrace:
[1] _quantilesort!(v::Vector{Union{Missing, Float64}}, sorted::Bool, minp::Float64, maxp::Float64)
@ Statistics /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/Statistics/src/Statistics.jl:980
[2] #quantile!#49
@ /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/Statistics/src/Statistics.jl:957 [inlined]
[3] quantile(v::Vector{Union{Missing, Float64}}, p::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}; sorted::Bool, alpha::Float64, beta::Float64)
@ Statistics /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/Statistics/src/Statistics.jl:1073
[4] quantile(v::Vector{Union{Missing, Float64}}, p::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64})
@ Statistics /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/Statistics/src/Statistics.jl:1073
[5] macro expansion
@ ~/.julia/packages/StatsPlots/dFNaF/src/boxplot.jl:41 [inlined]
[6] apply_recipe(plotattributes::AbstractDict{Symbol, Any}, #unused#::Type{Val{:boxplot}}, x::Any, y::Any, z::Any)
@ StatsPlots ~/.julia/packages/RecipesBase/qpxEX/src/RecipesBase.jl:289
[7] _process_seriesrecipe(plt::Any, plotattributes::Any)
@ RecipesPipeline ~/.julia/packages/RecipesPipeline/Bxu2O/src/series_recipe.jl:50
[8] _process_seriesrecipes!(plt::Any, kw_list::Any)
@ RecipesPipeline ~/.julia/packages/RecipesPipeline/Bxu2O/src/series_recipe.jl:27
[9] recipe_pipeline!(plt::Any, plotattributes::Any, args::Any)
@ RecipesPipeline ~/.julia/packages/RecipesPipeline/Bxu2O/src/RecipesPipeline.jl:97
[10] _plot!(plt::Plots.Plot, plotattributes::Any, args::Any)
@ Plots ~/.julia/packages/Plots/qbc7U/src/plot.jl:208
[11] plot(::Any, ::Vararg{Any}; kw::Base.Pairs{Symbol, V, Tuple{Vararg{Symbol, N}}, NamedTuple{names, T}} where {V, N, names, T<:Tuple{Vararg{Any, N}}})
@ Plots ~/.julia/packages/Plots/qbc7U/src/plot.jl:91
[12] boxplot(::Any, ::Vararg{Any}; kw::Base.Pairs{Symbol, V, Tuple{Vararg{Symbol, N}}, NamedTuple{names, T}} where {V, N, names, T<:Tuple{Vararg{Any, N}}})
@ Plots ~/.julia/packages/RecipesBase/qpxEX/src/RecipesBase.jl:410
[13] boxplot(::Any, ::Vararg{Any})
@ Plots ~/.julia/packages/RecipesBase/qpxEX/src/RecipesBase.jl:410
[14] top-level scope
@ REPL[18]:1