Wraps the plt with plotly::ggplotly() and sets the xaxis and yaxis ticks to "auto", so the axis labels are updated when zooming.

plot_interactive(plt)

Arguments

plt

A ggplot plot

Value

A plotly plot

Examples

d <- data.frame(x = c(1,2), y=c(1,2))
plt <- ggplot2::ggplot(d) + 
  ggplot2::geom_point(ggplot2::aes(x = x, y = y))
plot_interactive(plt)