julia> using PlotlyLight julia> try Plot(y=[NaN,NaN]) catch e @warn "NaN in plot" end Error showing value of type Plot: ERROR: NaN not allowed to be written in JSON spec
Probably because the
Plot() call does not throw. The
try/catch block returns a
Plot, which Julia then tries to show; that is when the exception is thrown.
I don’t know how
PlotlyLight works, but it’s possible that
Plot(y=[NaN,NaN]) |> display will throw.