gorilla-repl icon indicating copy to clipboard operation
gorilla-repl copied to clipboard

Difficulty plotting Infinity and NaN

Open paul-english opened this issue 10 years ago • 1 comments

This may be a Vega issue, if so I'll move it, but there are definite issues plotting extreme values.

Consider this function & plot,

(defn g [x] (Math/log (inc x)))
(plot g [-5 5])

paul-english avatar Jun 03 '14 00:06 paul-english

Oh, yes, that's not very good! I'm not really sure what the solution is, as I think the underlying problem is that JSON has no way of representing NaN or Infinity. At the moment Cheshire is converting them to strings in the JSON it outputs, which seems sensible, but it doesn't look as though Vega is handling them well.

I guess the options are:

  • check to see if Vega has a particular way it would like non-numeric values represented.
  • if not, strip them from the data before we transform to JSON.

JonyEpsilon avatar Jun 04 '14 10:06 JonyEpsilon