library(plotly)
df <- geo_usa_4
# geo styling
g <- list(
scope = 'usa',
projection = list(type = 'albers usa'),
showland = TRUE,
showlakes = FALSE,
landcolor = toRGB("gray95"),
subunitcolor = toRGB("gray85"),
countrycolor = toRGB("gray85"),
countrywidth = 0.5,
subunitwidth = 0.5
)
fig <- plot_geo(df, lat = ~long, lon = ~lat)
fig <- fig %>% add_markers(
text = ~paste(paste("Price:", m2_price), sep = "<br />"),
color = ~m2_price, symbol = I("square"), size = I(8), hoverinfo = "text"
)
fig <- fig %>% colorbar(title = "Price<br />")
fig <- fig %>% layout(
title = 'Warehouse price ($/m2/mo)<br />', geo = g
)
fig