Can it support NaN?
Freed-Wu opened this issue ยท 7 comments
When ys contain NaN, it will not display.
Thanks.
@Freed-Wu Thanks for the suggestion! I guess what you would want is that when plotting NaN's are silently dropped, right?
So plot([1,2,3])
should be itentical to plot([1,2,3,np.nan])
, right?
Okay got it, I'll look into it. Might be that I'll only get around to the simpler option of the above.
Let me know if you want to have a go at this yourself, and we'll coordinate
Not sure. I notice another library named plotext has same problem, however, it only ignore NaN (the simpler option of the above). I maybe try to solve piccolomo/plotext#114
@Freed-Wu It sounds like you have another solution now. In any case I've implemented the simple version we discussed in 0.6.0
and maybe I'll get around to the more sophisticated one eventually.
Thank you for your input!
You are welcome. ๐
This should now work as requested. ๐
>>> import numpy as np
>>> from uniplot import plot
>>> a = np.arange(10.)
>>> a[2:5] = [np.nan] * 3
>>> plot(a, lines=True)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โโโโโ
โ โโโโ โ 8
โ โโโโ โ
โ โโโโ โ
โ โโโโ โ
โ โโโโ โ
โ โโโโ โ
โ โโโ โ
โ โ
โ โ 4
โ โ
โ โ
โ โ
โ โ
โ โ
โ โโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ 0
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
2 5 7 10