1# Basic syntax:
2plt.axvline(x_coordinate)
3
4# Example usage:
5import matplotlib.pyplot as plt
6plt.figure(figsize=(5, 5))
7plt.axvline(x=10, ymin=0.10, ymax=0.70, color='b', ls='--', lw=1.5, label='axvline - % of full height')
8plt.legend(bbox_to_anchor=(1.0, 1), loc='best')
9plt.show()
10
11# Where:
12# - x is the x axis coordinate for the vertical line
13# - ymin is the minimum y-value to show
14# - ymax is the maximum y-value to show
15# - ls is the line style (see also '-', '-.', and ':')
16# - lw is the line width
1xposition = [0.3, 0.4, 0.45]
2for xc in xposition:
3 plt.axvline(x=xc, color='k', linestyle='--')