Examples for 'plotly::ggplotly'


Convert ggplot2 to plotly

Aliases: ggplotly

Keywords:

### ** Examples

## Not run: 
##D # simple example
##D ggpenguins <- qplot(bill_length_mm , body_mass_g, 
##D data = palmerpenguins::penguins, color = species)
##D ggplotly(ggpenguins)
##D 
##D data(canada.cities, package = "maps")
##D viz <- ggplot(canada.cities, aes(long, lat)) +
##D   borders(regions = "canada") +
##D   coord_equal() +
##D   geom_point(aes(text = name, size = pop), colour = "red", alpha = 1/2)
##D ggplotly(viz, tooltip = c("text", "size"))
##D 
##D # linked scatterplot brushing
##D d <- highlight_key(mtcars)
##D qplot(data = d, x = mpg, y = wt) %>%
##D   subplot(qplot(data = d, x = mpg, y = vs)) %>% 
##D   layout(title = "Click and drag to select points") %>%
##D   highlight("plotly_selected")
##D 
##D 
##D # more brushing (i.e. highlighting) examples
##D demo("crosstalk-highlight-ggplotly", package = "plotly")
##D 
##D # client-side linked brushing in a scatterplot matrix
##D highlight_key(palmerpenguins::penguins) %>%
##D   GGally::ggpairs(aes(colour = Species), columns = 1:4) %>%
##D   ggplotly(tooltip = c("x", "y", "colour")) %>%
##D   highlight("plotly_selected")
## End(Not run)

[Package plotly version 4.10.0 Index]