-
Notifications
You must be signed in to change notification settings - Fork 608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
log scale with zero data should give a better warning #3911
Comments
Vega-Lite actually never sees the data so the warning would need to be in Vega. |
@domoritz should I go file this in vega's issues? |
One thing we could do in Vega-Lite is automatically filter out values less or equal to zero (in https://github.com/vega/vega-lite/blob/master/src/compile/data/filterinvalid.ts) but that seems like it could have all kinds of bad effects. Yes, I think this needs to be in Vega itself. |
We used to, but not any more. (Look at the code you link to.) |
What do you mean? I know that we used to and we don't right now but I linked to the code where we would add this functionality. |
wouldn't it be better to plot the invalid values as missing values? |
@g3o2 yes. We haven't figured out a good way to show missing values in all chart types. |
Oh I see. We intentionally remove that filter because it's magical so I don't think we should add it back. Plus, D3 log scale works with either strictly positive or strictly negative values, so it's quite tricky to write the right filter.
Yes, but invalid values is also a part of scale domain and thus it will break the scale like shown in the screenshot at the top of this issue. Filtering it correctly can be tricky. |
In Altair, I had a column of data that I plotted on a log scale:
and a zero snuck into the column that I didn't know about and the debugging of that took a really really long time. Here's what Altair output looked like:
I guess I would have expected that the zeroes would be silently dropped OR the console would have thrown a warning ... anyway, the Altair output was perplexing. One zero out of several hundred data points made everything plot on a single line.
@jakevdp suggested this was the right place to raise the issue (vega/altair#953).
The text was updated successfully, but these errors were encountered: