plot_mapbox | R Documentation |
Use this function instead of plot_ly()
to initialize
a plotly-mapbox object. This enforces the entire plot so use
the scattermapbox trace type, and enables higher level geometries
like add_polygons()
to work
plot_mapbox(data = data.frame(), ...)
data |
A data frame (optional). |
... |
arguments passed along to |
Carson Sievert
plot_ly()
, plot_geo()
, ggplotly()
## Not run:
plot_mapbox(res_mn)
plot_mapbox(res_mn, color = ~INDRESNAME)
map_data("world", "canada") %>%
group_by(group) %>%
plot_mapbox(x = ~long, y = ~lat) %>%
add_polygons() %>%
layout(
mapbox = list(
center = list(lat = ~median(lat), lon = ~median(long))
)
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.