Here is the explanation for the preceding code:
- matplotlib.use('tkagg') sets up a Tkinter backend for displaying the animation
- fig = plt.figure(figsize=(6, 6)) defines the figure
- def animate(longitude): is the function to update the map with new frames as they come in:
- ax = plt.gca() gets currently active axes' references.
- ax.remove() deletes the plot on this axis, if it is already there.
- ax = plt.axes([0, 0, 1, 1], projection=ccrs.Geostationary(central_longitude=longitude)) refreshes the map on the axes with the current longitude received by this function, using a Geostationary projection.
- ax.coastlines() adds the coastlines feature to the map.
- ax.stock_img() adds the background image to the map.
- ax.gridlines() adds grid ...