import folium

all = ['plot_circle']


def plot_circle(lat, lon, radius=2000, map=None, **kwargs):
    """
    Plot a circle on a map (creating a new folium map instance if necessary).

    Parameters
    ----------

    lat: float
        latitude of circle to plot (degrees)
    lon: float
        longitude of circle to plot (degres)
    radius: float
        radius of circle to plot (m)
    map: folium.Map
        existing map object

    Returns
    -------

    Folium map object

    Examples
    --------

    >>> import folium
    >>> plot_circle(52.79, -2.95, 1e3, map=None)
    """

    if not map:
        map = folium.Map(location=(lat, lon), control_scale=True)


    
    folium.Circle(location=[lat, lon], radius=radius, fill=True,
                  fillOpacity=0.6, **kwargs).add_to(map)

    return map

