Session Ready
Exercise

Plotting centroid coordinates

Because we can't plot whole bounding boxes, we summarize the bounding box location into a single point called a centroid. Plotting these on a Basemap map is straightforward. Once we calculate the centroids, we separate the longitudes and latitudes, then pass to the .scatter() method.

The Basemap object m has been created for you. The dataset tweets_sotu and function calculateCentroid() have also been loaded.

Instructions
100 XP
  • Calculate the centroids and store in centroids.
  • Set the argument zorder in fillcontinents such that the continents appear behind the points.
  • Plot the points. Remember to set the latlon argument to the correct value.