3 ms·
Thanks, I found this interesting. > And I couldn’t combine a log-scale with setting the domain of the x-scale to zero I don't think it's mathematically possib
by jcheng 10y ago
Thanks, I found this interesting.
> And I couldn’t combine a log-scale with setting the domain of the x-scale to zero
I don't think it's mathematically possible to have a log scale start at zero, you just make the exponent more and more negative. The first two charts look like you've done it but they're not correct--you don't want the values to be log, you want the scale to be log. In ggplot2 you do this by adding "scale_x_log10()" to the plotting expression, and in native R you usually pass log="x" (I believe).
- lisacrost 10y agoGreat point! I'm surprised that nobody else noticed that so far :) sometimes I set the values to log because I couldn't find an option to set the scale to log, but you're right, in R and ggplot2 I should use your described options.
- hadley 10y agoAnd on a log scale you probably want to set the minimum value to 1 since the log of zero is negative infinity (I suspect that's the root cause of your ggvis problem)