ggplotly: Create plotly graphs using ggplot2 syntax

Description Usage Arguments Value Author(s) See Also Examples

Description

See up-to-date documentation and examples at https://plot.ly/ggplot2

Usage

1
2
ggplotly(p = ggplot2::last_plot(), width = NULL, height = NULL,
  tooltip = "all", originalData = TRUE, source = "A", ...)

Arguments

p

a ggplot object.

width

Width of the plot in pixels (optional, defaults to automatic sizing).

height

Height of the plot in pixels (optional, defaults to automatic sizing).

tooltip

a character vector specifying which aesthetic mappings to show in the tooltip. The default, "all", means show all the aesthetic mappings (including the unofficial "text" aesthetic). The order of variables here will also control the order they appear. For example, use tooltip = c("y", "x", "colour") if you want y first, x second, and colour last.

originalData

should the "original" or "scaled" data be returned?

source

Only relevant for event_data.

...

arguments passed onto methods.

Value

a plotly object

Author(s)

Carson Sievert

See Also

signup, plot_ly

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
# simple example
ggiris <- qplot(Petal.Width, Sepal.Length, data = iris, color = Species)
ggplotly(ggiris)

data(canada.cities, package = "maps")
viz <- ggplot(canada.cities, aes(long, lat)) +
  borders(regions = "canada") +
  coord_equal() +
  geom_point(aes(text = name, size = pop), colour = "red", alpha = 1/2)
ggplotly(viz, tooltip = c("text", "size"))

## End(Not run)

gvarunkumar/plotly documentation built on May 17, 2019, 9:29 a.m.