demo/sf-geo.R

library(plotly)

storms <- sf::st_read(system.file("shape/storms_xyz.shp", package = "sf"), quiet = TRUE)

subplot(
  nrows = 2, 
  plot_geo(storms, name = "2D storms"),
  plot_geo(storms, name = "3D storms") %>% 
    layout(
      geo = list(
        projection = list(type = "orthographic"),
        lonaxis = list(showgrid = TRUE, gridcolor = "gray"),
        lataxis = list(showgrid = TRUE, gridcolor = "gray")
      )
    )
)

Try the plotly package in your browser

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

plotly documentation built on May 29, 2024, 2:23 a.m.