def build_planet_position_lists(time_positions, planet_names):
    """
    Reformat export for matplot lib, Returns a dict of the following format
    {
        'planet_1': {'x': [1,2,3],
                     'y': [4,5,6],
                    },

        'planet_2': {'x': [1,2,3],
                     'y': [4,5,6],
                    },
        ...
    }
    """
    planet_dict = {}
    for planet_name in planet_names:
        x_positions = [time_position.positions[planet_name].x for time_position in time_positions]
        y_positions = [time_position.positions[planet_name].y for time_position in time_positions]
        planet_dict[planet_name] = {'x': x_positions, 'y': y_positions}

    return planet_dict