Hi, I am a bit confused about the scale in ggvis. I am trying to do two things: one has a log scale (equivalent to log = "x" in plot ()). I am also looking for the equivalent of xlim = c (). In both cases, the code below does not give the expected results.
# install.packages("ggvis", dependencies = TRUE) library(ggvis) df <- data.frame(a=c(1, 2, 3, 1000, 10000), b=c(0.1069, 0.0278, 0.0860, 15.5640, 30.1745)) df %>% ggvis(~a, ~b) df %>% ggvis(~a, ~b) %>% scale_numeric("x", trans="log")
Note that with trans = "log" all points are located to the left of the graph, and the scale disappears.
Next, I want to limit the graph to certain values. I could multiply the data frame, but I want to have the xlim equivalent of plot ().
df %>% ggvis(~a, ~b) %>% scale_numeric("x", trans="linear", domain=c(10, 40))
This gives even more compelling results, so I guess I'm wrong about what the domain does.
Thank you for your help!
source share