rstudio / ggvis

Interactive grammar of graphics for R
Other
713 stars 171 forks source link

format='p' not rounding all axis values with same precision #436

Open mwillumz opened 9 years ago

mwillumz commented 9 years ago
df <- data.frame(id = 1:10, number = runif(10,0,0.01))

The following is not a satisfactory way to format small percentage values due to the rounding of the y axis:

df %>% ggvis(~id, ~number) %>%
  layer_points() %>%
  add_axis("y", format = "%")

image

If I use the following approach I consistently get a rounding precision error for one or more of the axis labels.

df %>% ggvis(~id, ~number) %>%
  layer_points() %>%
  add_axis("y", format = "p")

image

cdeterman commented 8 years ago

I have also seen this happening. Is there any current working solution?