def axes_contains(ax, obj_list):
    """
    Check that a matplotlib.Axes instance contains certain elements.
    
    Parameters
    ----------
    ax : matplotlib.Axes
        Axes instance.
        
    obj_list : list of tuples
        List of tuples, one for each type of object to look for. The tuple 
        should be of the form (matplotlib.object, int), where int is the 
        number of instances of that object that are expected.
    """
    # Get plot elements
    elems = ax.get_children()
    
    # Loop over list of objects that should be in the plot
    contains_all = False
    for obj in obj_list:
        objtype, num_expected = obj
        num = 0
        for elem in elems:
            if isinstance(elem, objtype): num += 1
        if num != num_expected:
            return False
    
    # Return True if no problems found
    return True