JuliaPlots/Plots.jl

Support for `missing` in Plots

Open

#1,706 opened on Aug 28, 2018

View on GitHub
 (24 comments) (14 reactions) (0 assignees)Julia (381 forks)batch import
help wanted

Repository metrics

Stars
 (1,943 stars)
PR merge metrics
 (Avg merge 3d 12h) (2 merged PRs in 30d)

Description

Plots doesn't yet support missing, which it should, since it's in Base.

The current approach taken in StatPlots is to copy the inputs, replacing missing with NaN for Vector{<:Number} (while converting to Float64), "" for String input and Symbol() for Symbol input, then propagating that. It should be possible to do so for the x, y and z arguments here https://github.com/JuliaPlots/Plots.jl/blob/602dbdf1d260ef07daa2a2bdae558d82299e3d96/src/series.jl#L75-L88 , as we already copy the input. It's more tricky for everything passed as keyword arguments, but the question is how often they'd contain missing.

Personally I think a cleaner approach is to provide first-class missings support in wrapping internal calls in Plots that may return missing in skipmissing where relevant and just forward the missing-containing Vectors to the backend and leave it to them to handle them. That makes sense since missing is defined in Base, and as such a first-class Julia citizen. But it's more work and we don't know how well the backends handle them.

@piever @daschw @SimonDanisch @pfitzseb @jheinen

Contributor guide