This is part of the preliminary data analysis of a course project. Data is collected from the National Statistical Beureau of China and in the unit of thousand tons. In the beginning, I start with a comprehensive table called data, where for each province there's a matrix of 20 by 31, i.e. transport to each province w.r.t. different years. Therefore, it's convenient to extract the actual transient matrix for each year by using the method groupby of Pandas.

## Import Packages

The most important one is networkx in this project.

## Plotting Functions

There're two functions, draw_networkx_edges_with_arrows for directed edges drawing, plot_network for whole networks drawing.

## Data Preparation and Plotting

As I mentioned in the beginning, here the transient matrices are extracted by groupby. For further usage, we save then by specifying the parameter save in plot_network to be True.

## GIF Generation

Key package here is imageio. I've set the limit for maximum pixel to 1e10 in case there's any overflow due to large figures in the above steps.

Well, I have to say it looks gorgeous.