Black Lives Matter. Please consider donating to Black Girls Code today.
Dash HoloViews is now available! Check out the docs.

Blank output on viewer for Line on Map


I am extremely new to plotly in R Studio and trying to replicate the Line on Map graph in Plotly website. However, I am changing nothing and just running it. I am getting a blank output in the viewer.

Not sure what to look out for. Thanks a lot.


airport locations

air <- read.csv(‘’)

flights between airports

flights <- read.csv(‘’)
flights$id <- seq_len(nrow(flights))

map projection

geo <- list(
scope = ‘north america’,
projection = list(type = ‘azimuthal equal area’),
showland = TRUE,
landcolor = toRGB(“gray95”),
countrycolor = toRGB(“gray80”)

p <- plot_geo(locationmode = ‘USA-states’, color = I(“red”)) %>%
data = air, x = ~long, y = ~lat, text = ~airport,
size = ~cnt, hoverinfo = “text”, alpha = 0.5
) %>%
data = group_by(flights, id),
x = ~start_lon, xend = ~end_lon,
y = ~start_lat, yend = ~end_lat,
alpha = 0.3, size = I(1), hoverinfo = “none”
) %>%
title = ‘Feb. 2011 American Airline flight paths
(Hover for airport names)’,
geo = geo, showlegend = FALSE


Hey @sambitnandi.ju

could you try opening this in an external browser (as opposed to the viewer) to see if it works.

Also, are you using windows or mac?

Yup that’s what I am doing now. The external browser thing is working gperfect