How to use the geoplot.sankey function in geoplot

To help you get started, we’ve selected a few geoplot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ResidentMario / geoplot / tests / input_tests.py View on Github external
gplt.sankey(start=map_start_points(), end=map_end_points())

            gplt.sankey(start=list_start_points, end=list_end_points)
            gplt.sankey(start=list_start_points, end=list_end_points)

            gplt.sankey(start=series_start_points, end=series_end_points)
            gplt.sankey(start=series_start_points, end=series_end_points)

            gplt.sankey(start=map_start_points(), end=map_end_points())
            gplt.sankey(start=map_start_points(), end=map_end_points())

            gplt.sankey(dataframe_gaussian_points, start='starts', end='ends')

            gplt.sankey(path=list_paths)
            gplt.sankey(path=series_paths)
            gplt.sankey(path=map_paths())

            gplt.sankey(dataframe_gaussian_points, path='paths')

        finally:
            plt.close('all')
github ResidentMario / geoplot / tests / kwarg_tests.py View on Github external
def test_sankey(self):
        try:
            gplt.sankey(path=list_paths, projection=gcrs.PlateCarree(), edgecolor='white')
            gplt.sankey(path=list_paths, projection=gcrs.PlateCarree(), color='white')
            gplt.sankey(path=list_paths, projection=gcrs.PlateCarree(), linewidth=1)
            gplt.sankey(path=list_paths, projection=gcrs.PlateCarree(), linestyle='--')
        finally:
            plt.close()
github ResidentMario / geoplot / tests / input_tests.py View on Github external
def test_sankey(self):
        try:
            gplt.sankey(start=map_start_points(), end=map_end_points())
            gplt.sankey(start=map_start_points(), end=map_end_points())

            gplt.sankey(start=list_start_points, end=list_end_points)
            gplt.sankey(start=list_start_points, end=list_end_points)

            gplt.sankey(start=series_start_points, end=series_end_points)
            gplt.sankey(start=series_start_points, end=series_end_points)

            gplt.sankey(start=map_start_points(), end=map_end_points())
            gplt.sankey(start=map_start_points(), end=map_end_points())

            gplt.sankey(dataframe_gaussian_points, start='starts', end='ends')

            gplt.sankey(path=list_paths)
            gplt.sankey(path=series_paths)
            gplt.sankey(path=map_paths())

            gplt.sankey(dataframe_gaussian_points, path='paths')

        finally:
            plt.close('all')
github ResidentMario / geoplot / docs / gallery / plot_los_angeles_flights.py View on Github external
la_flights, scale='Passengers', hue='Passengers', cmap='Purples', ax=axarr[0][1]
)
ax.set_global()
ax.outline_patch.set_visible(True)
ax.stock_img()

ax = gplt.sankey(
    la_flights, scale='Passengers', hue='Passengers', cmap='Purples', ax=axarr[1][0]
)
ax.set_global()
ax.outline_patch.set_visible(True)
ax.gridlines()
ax.coastlines()
ax.add_feature(cartopy.feature.BORDERS)

ax = gplt.sankey(
    la_flights, scale='Passengers', hue='Passengers', cmap='Purples', ax=axarr[1][1]
)
ax.set_global()
ax.outline_patch.set_visible(True)
ax.coastlines()
ax.add_feature(cartopy.feature.LAND)
ax.add_feature(cartopy.feature.OCEAN)
ax.add_feature(cartopy.feature.LAKES)
ax.add_feature(cartopy.feature.RIVERS)

plt.savefig("los-angeles-flights.png", bbox_inches='tight', pad_inches=0.1)
github ResidentMario / geoplot / docs / gallery / plot_los_angeles_flights.py View on Github external
ax = gplt.sankey(
    la_flights, scale='Passengers', hue='Passengers', cmap='Purples', ax=axarr[0][0]
)
ax.set_global()
ax.outline_patch.set_visible(True)
ax.coastlines()

ax = gplt.sankey(
    la_flights, scale='Passengers', hue='Passengers', cmap='Purples', ax=axarr[0][1]
)
ax.set_global()
ax.outline_patch.set_visible(True)
ax.stock_img()

ax = gplt.sankey(
    la_flights, scale='Passengers', hue='Passengers', cmap='Purples', ax=axarr[1][0]
)
ax.set_global()
ax.outline_patch.set_visible(True)
ax.gridlines()
ax.coastlines()
ax.add_feature(cartopy.feature.BORDERS)

ax = gplt.sankey(
    la_flights, scale='Passengers', hue='Passengers', cmap='Purples', ax=axarr[1][1]
)
ax.set_global()
ax.outline_patch.set_visible(True)
ax.coastlines()
ax.add_feature(cartopy.feature.LAND)
ax.add_feature(cartopy.feature.OCEAN)
github ResidentMario / geoplot / examples / plot_minard_napoleon_russia.py View on Github external
interactive scrolly-panny version of this webmap built with ``mplleaflet``. To learn more about
``mplleaflet``, refer to `the mplleaflet GitHub repo `_.
"""

import geopandas as gpd
import geoplot as gplt
import matplotlib.pyplot as plt
import mplleaflet
from matplotlib.colors import LinearSegmentedColormap

napoleon_troop_movements = gpd.read_file(gplt.datasets.get_path('napoleon_troop_movements'))

colors = [(215/255, 193/255, 126/255), (37/255, 37/255, 37/255)]
cm = LinearSegmentedColormap.from_list('minard', colors)

gplt.sankey(
    napoleon_troop_movements,
    scale='survivors', limits=(0.5, 45),
    hue='direction',
    cmap=cm
)
fig = plt.gcf()
plt.savefig("minard-napoelon-russia.png", bbox_inches='tight', pad_inches=0.1)
github ResidentMario / geoplot / docs / gallery / plot_minard_napoleon_russia.py View on Github external
`Click here to see the interactive webmap version. 
`_
"""

import geopandas as gpd
import geoplot as gplt
import matplotlib.pyplot as plt
import mplleaflet
from matplotlib.colors import LinearSegmentedColormap

napoleon_troop_movements = gpd.read_file(gplt.datasets.get_path('napoleon_troop_movements'))

colors = [(215/255, 193/255, 126/255), (37/255, 37/255, 37/255)]
cm = LinearSegmentedColormap.from_list('minard', colors)

gplt.sankey(
    napoleon_troop_movements,
    scale='survivors', limits=(0.5, 45),
    hue='direction',
    cmap=cm
)
fig = plt.gcf()
plt.savefig("minard-napoelon-russia.png", bbox_inches='tight', pad_inches=0.1)
github ResidentMario / geoplot / _downloads / 51fc136e1ef1d377ee077584c5363ae5 / plot_dc_street_network.py View on Github external
Sankey of traffic volumes in Washington DC
==========================================

This example plots 
`annual average daily traffic volume `_
in Washington DC.
"""

import geopandas as gpd
import geoplot as gplt
import geoplot.crs as gcrs
import matplotlib.pyplot as plt

dc_roads = gpd.read_file(gplt.datasets.get_path('dc_roads'))

gplt.sankey(
    dc_roads, projection=gcrs.AlbersEqualArea(),
    scale='aadt', limits=(0.1, 10), color='black'
)

plt.title("Streets in Washington DC by Average Daily Traffic, 2015")
plt.savefig("dc-street-network.png", bbox_inches='tight', pad_inches=0.1)
github ResidentMario / geoplot / docs / gallery / plot_dc_street_network.py View on Github external
Sankey of traffic volumes in Washington DC
==========================================

This example demonstrates an application of the ``sankey`` plot type to a geospatial dataset of
`annual average daily traffic volume 
`_ in Washington DC.
"""

import geopandas as gpd
import geoplot as gplt
import geoplot.crs as gcrs
import matplotlib.pyplot as plt

dc_roads = gpd.read_file(gplt.datasets.get_path('dc_roads'))

gplt.sankey(
    dc_roads, projection=gcrs.AlbersEqualArea(),
    scale='aadt', limits=(0.1, 10), color='black'
)

plt.title("Streets in Washington DC by Average Daily Traffic, 2015")
plt.savefig("dc-street-network.png", bbox_inches='tight', pad_inches=0.1)
github ResidentMario / geoplot / docs / gallery / plot_los_angeles_flights.py View on Github external
import geopandas as gpd
import geoplot as gplt
import geoplot.crs as gcrs
import matplotlib.pyplot as plt
import cartopy

la_flights = gpd.read_file(gplt.datasets.get_path('la_flights'))


f, axarr = plt.subplots(2, 2, figsize=(12, 12), subplot_kw={
    'projection': gcrs.Orthographic(central_latitude=40.7128, central_longitude=-74.0059)
})
plt.suptitle('Popular Flights out of Los Angeles, 2016', fontsize=16)
plt.subplots_adjust(top=0.95)

ax = gplt.sankey(
    la_flights, scale='Passengers', hue='Passengers', cmap='Purples', ax=axarr[0][0]
)
ax.set_global()
ax.outline_patch.set_visible(True)
ax.coastlines()

ax = gplt.sankey(
    la_flights, scale='Passengers', hue='Passengers', cmap='Purples', ax=axarr[0][1]
)
ax.set_global()
ax.outline_patch.set_visible(True)
ax.stock_img()

ax = gplt.sankey(
    la_flights, scale='Passengers', hue='Passengers', cmap='Purples', ax=axarr[1][0]
)