ggplot(flight_speeds, aes(x =reorder(dest, avg_speed), y = avg_speed, fill = avg_speed)) +geom_col(show.legend =FALSE) +coord_flip() +scale_fill_gradient(low ="lightblue", high ="darkblue") +labs(title ="Average Flight Speed by Destination (NYC, 2023)",x ="Destination Airport Code",y ="Average Speed (mph)",caption ="Source: nycflights23 package" )
Summary
This chart shows the average flight speed to different destinations from NYC in 2013. I calculated speed by dividing the distance by air time and then took the average for each destination. It tells us that the further the destination is, the faster the plane goes. I filtered the data to only include destinations with more than 10,000 flights. I did this because when I included all destinations, the chart became super crammed with airport codes, and it was hard to read. I wanted to include all of them, but I wasn’t sure how to fix the spacing. Maybe if I could make the chart interactive, I could include everything and just show the details, exact average speed and full airport name, when you hover over each bar with the mouse. That way it wouldn’t look messy, and you could still see all the info one at a time.