diff --git a/src/PyPlot.jl b/src/PyPlot.jl index e80db2f..b6d21b3 100755 --- a/src/PyPlot.jl +++ b/src/PyPlot.jl @@ -310,6 +310,14 @@ function withfig(actions::Function, f::Figure; clear=true) return f end +########################################################################### +# extend PyObject to maskedarray to allow for plotting with missing values + +function PyObject(a::Array{Union{T,Missing},N}) where {T,N} + numpy_ma = PyCall.pyimport("numpy").ma + pycall(numpy_ma.array, Any, coalesce.(a,zero(T)), mask=ismissing.(a)) +end + ########################################################################### using LaTeXStrings