JuliaPlots/Plots.jl

Support for `missing` in Plots

Open

#1706 aperta il 28 ago 2018

Vedi su GitHub
 (24 commenti) (14 reazioni) (0 assegnatari)Julia (381 fork)batch import
help wanted

Metriche repository

Star
 (1943 star)
Metriche merge PR
 (Merge medio 3g 12h) (2 PR mergiate in 30 g)

Descrizione

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

Guida contributor