def get_abs_axis_pos(rel_pos, ax):
    """
    Find coordinates in terms of axis quantities, given relative coordinates from 0 to 1,
    so that e.g. (1,1) refers to (xmax,ymax)

    :param rel_pos: relative coordinates
    :param ax: axis
    :return: absolute coordinates
    """

    xlims = ax.get_xlim()
    ylims = ax.get_ylim()

    return (xlims[0] + rel_pos[0] * (xlims[1] - xlims[0]), ylims[0] + rel_pos[1] * (ylims[1] - ylims[0]))