Geographic Points#

A geographic points plot showing (earthquakes) plotted with their correct geographic coordinates and spatial reference system. This example uses the earthquakes dataset. GeoViews needs to be installed to enable the features option. Earthquake locations are expressed in lat/lon coordinates and are projected with the Plate Carree projection.

import hvplot.pandas  # noqa

df = hvplot.sampledata.earthquakes("pandas")

df.hvplot.points(
    x='lon',
    y='lat',
    title='Earthquake Locations (Bokeh)',
    xlabel='Longitude',
    ylabel='Latitude',
    alpha=0.5,
    color='mag',
    cmap='viridis_r',
    geo=True,
    features=['coastline'],
)
/Users/runner/work/hvplot/hvplot/.pixi/envs/docs/lib/python3.11/site-packages/cartopy/io/__init__.py:242: DownloadWarning: Downloading: https://naturalearth.s3.amazonaws.com/110m_physical/ne_110m_coastline.zip
  warnings.warn(f'Downloading: {url}', DownloadWarning)
import hvplot.pandas  # noqa
hvplot.extension('matplotlib')

df = hvplot.sampledata.earthquakes("pandas")

df.hvplot.points(
    x='lon',
    y='lat',
    title='Earthquake Locations (Matplotlib)',
    xlabel='Longitude',
    ylabel='Latitude',
    alpha=0.5,
    color='mag',
    cmap='viridis_r',
    geo=True,
    features=['coastline'],
    width=700,
)
This web page was generated from a Jupyter notebook and not all interactivity will work on this website.