You can add this inside your loop to draw the dashed lines:
ax.vlines(x_val, y_min - 0.1, y_max + 0.1, linestyle='--', color=line.get_color())
It uses the same color as the patient’s line and goes a bit below/above the data range. Super simple fix đŸ™‚