ggvis
ggvis copied to clipboard
Scale expansion causes log scales to display incorrectly
This is because the expansion can cause the scale domain to contain negative values, which don't work with log scales.
p <- pressure %>%
ggvis(~temperature, ~pressure) %>%
layer_lines()
p
# Problem:
p %>% scale_numeric("y", trans = "log")
# OK:
p %>% scale_numeric("y", trans = "log", expand = 0)
+1. This should not fail silently; at least a warning would be nice.
Hi, expand = 0 seems to work in this example but it does not work on my dataset. I assume that your solution is only applicable to pre-baked data set such as mtcars or pressure?
I tried both scale_numeric("y", trans = "log", expand = 0) and ~log10(data) directly in mapping....
They both result in the same plot.

@udaniel Check if your data contains a 0. That was the problem with mine.