def _labeled_line(ax, name, y_pos, color, pos="center"):
    """Draw a line to the axis, returning the line and the annotation."""
    x_pos = {"center": 0, "left": ax.dataLim.bounds[0]}[pos]
    line = ax.axhline(y_pos, c=color)
    anno = ax.annotate(name, xy=(0, y_pos), xytext=(x_pos, y_pos + 3))
    return line, anno