In this recipe, we will learn how to plot an animated map for the purposes of three-dimensional visualization.
Plotting an animated map
Getting ready
You'll need to import the required libraries using the following commands:
import cartopy.crs as ccrs
import matplotlib.animation as animation
import matplotlib.pyplot as plt
import numpy as np
How to do it...
The following are the steps to plot an animated map and save it as an MP4 file:
- Set up the backend on which the map is to be animated, as follows:
import matplotlib
matplotlib.use('tkagg')
- Define the figure...