demo/size.r

library(ggvis)

# Set size to 300x300 pixels
mtcars %>% ggvis(x = ~wt, y = ~mpg) %>%
  layer_points() %>%
  set_options(width = 300, height = 300)

# Set size to 300x300 pixels, and add 50 pixels padding on all sides
mtcars %>% ggvis(x = ~wt, y = ~mpg) %>%
  layer_points() %>%
  set_options(width = 300, height = 300, padding = padding(50, 50, 50, 50))

Try the ggvis package in your browser

Any scripts or data that you put into this service are public.

ggvis documentation built on May 29, 2024, 1:12 a.m.