38 lines
968 B
Python
38 lines
968 B
Python
import matplotlib.pyplot as plt
|
|
|
|
from metro1_data import tas, costs
|
|
|
|
# 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=(7, 5))
|
|
|
|
plt.plot(tas, costs, 'o-')
|
|
|
|
idx = 3
|
|
plt.plot([tas[idx], tas[idx+1], tas[idx+1]],
|
|
[costs[idx], costs[idx], costs[idx+1]],
|
|
linestyle='dashed', color='black')
|
|
plt.annotate('$b_i$', ((tas[idx]+tas[idx+1])/2, (costs[idx]+costs[idx+1])/2),
|
|
va='top', ha='left')
|
|
|
|
plt.xlabel('$ta$')
|
|
plt.ylabel('$c$')
|
|
plt.xlim(tas[0], tas[-1])
|
|
# plt.ylim(bottom=0)
|
|
plt.tight_layout()
|
|
plt.show()
|