def axis_lengths(ax):
    """
    Takes a matplotlib axis and returns the length of the axes
    :param ax: The Axes instance to find the lengths of
    :return: length of x and y axis
    """
    xlim = ax.get_xlim()
    ylim = ax.get_ylim()
    dx = abs(xlim[1] - xlim[0])
    dy = abs(ylim[1] - ylim[0])
    return dx, dy
