metrosim/docs/plots/network.py

33 lines
980 B
Python

import matplotlib.pyplot as plt
# Update matplotlib parameters.
params = {'text.usetex': True,
'figure.dpi': 200,
'font.size': 14,
'font.serif': [],
'font.sans-serif': [],
'font.monospace': [],
'axes.labelsize': 16,
'axes.titlesize': 18,
'axes.linewidth': .6,
'legend.fontsize': 14,
'xtick.labelsize': 12,
'ytick.labelsize': 12,
'font.family': 'serif'}
plt.rcParams.update(params)
plt.figure(figsize=(8, 2))
plt.plot([0, 1, 3, 4], [1, 1, 1, 1], '-o', color='black')
plt.plot([1, 2, 3], [1, 0, 1], '-o', color='black')
plt.annotate('1', (0, 1), (0, .9), va='top', ha='center')
plt.annotate('2', (1, 1), (1, .9), va='top', ha='center')
plt.annotate('3', (2, 0), (2, -.1), va='top', ha='center')
plt.annotate('4', (3, 1), (3, .9), va='top', ha='center')
plt.annotate('5', (4, 1), (4, .9), va='top', ha='center')
plt.axis('off')
plt.tight_layout()
plt.show()