Skip to content

Plotting mixture of measurements and missing data #149

@chriswaudby

Description

@chriswaudby

Hi,

I've got some results that are a mixture of measurements and missing data (type Vector{Union{Missing, Measurement{Float64}}}). However, I get a MethodError if I try to plot these:

plot([1±.1, 2±.3, missing, 4±.05])
MethodError: no method matching Float64(::Measurements.Measurement{Float64})
Closest candidates are:
(::Type{T})(::Real, !Matched::RoundingMode) where T<:AbstractFloat
@ Base rounding.jl:207
(::Type{T})(::T) where T<:Number
@ Core boot.jl:792
(::Type{T})(!Matched::AbstractChar) where T<:Union{AbstractChar, Number}
@ Base char.jl:50
...
convert(::Type{Float64}, ::Measurements.Measurement{Float64})@number.jl:7
setproperty!(::Plots.Extrema, ::Symbol, ::Measurements.Measurement{Float64})@Base.jl:38
expand_extrema!@axes.jl:425[inlined]
#113@axes.jl:444[inlined]
foreach(::Plots.var"#113#114"{Plots.Extrema}, ::Vector{Measurements.Measurement{Float64}})@abstractarray.jl:3073
expand_extrema!(::Plots.Axis, ::Vector{Measurements.Measurement{Float64}})@axes.jl:444
expand_extrema!(::Plots.Subplot{Plots.GRBackend}, ::RecipesPipeline.DefaultsDict)@axes.jl:479
_expand_subplot_extrema(::Plots.Subplot{Plots.GRBackend}, ::RecipesPipeline.DefaultsDict, ::Symbol)@pipeline.jl:433
add_series!(::Plots.Plot{Plots.GRBackend}, ::RecipesPipeline.DefaultsDict)@pipeline.jl:376
_process_seriesrecipe(::Any, ::Any)@series_recipe.jl:46
_process_seriesrecipes!(::Any, ::Any)@series_recipe.jl:27
recipe_pipeline!(::Any, ::Any, ::Any)@RecipesPipeline.jl:99
_plot!(::Plots.Plot, ::Any, ::Any)@plot.jl:223
#plot#188@plot.jl:102[inlined]
plot@plot.jl:93[inlined]

Not sure if this is best raised here or with Plots!

Best,

Chris

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions