Mapping language families
Let’s return to our two examples of Nilo-Saharan language family trees. To examine differences in structure, we’ll need to first create these in NetworkX. For the Dimmendaal family tree, we’ll break with the tree structure slightly to show the interrelationships that exist for some of the child subfamilies. Let’s get started by creating and plotting the Greenberg tree with Script 11.1
:
#load needed packages import numpy as np import networkx as nx import matplotlib.pyplot as plt #create the Greenberg Nilo-Saharan language family network G = nx.Graph() G.add_nodes_from([1, 11]) G.add_edges_from([(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(7,8), (7,9),(7,10),(7,11)]) #plot the Greenberg Nilo-Saharan language family network import matplotlib.pyplot as plt G.nodes[1]['subfamily'] = 'Nilo_Saharan' G.nodes[2]['subfamily'] = 'Koman' G.nodes[3]['subfamily'...