City Populations 2050#
Download this notebook from GitHub (right-click to download).
import pandas as pd
import geoviews as gv
import geoviews.tile_sources as gvts
gv.extension('bokeh')
Declare data#
cities = pd.read_csv('../../assets/cities.csv', encoding="ISO-8859-1")
points = gv.Points(cities, ['Longitude', 'Latitude'], ['City', 'Population', 'Country', 'Year'],
label='Top 20 Cities by population in 2050').select(Year=2050).sort('Population').iloc[-20:]
Plot#
(gvts.CartoMidnight *
points.opts(
size=gv.dim('Population')*0.000002, fill_color='Population', line_color='gray', cmap='viridis',
width=700, height=600, global_extent=True, tools=['hover'], show_legend=False) *
gv.Labels(points).opts(
text_font_size='8pt', text_color='white'))
This web page was generated from a Jupyter notebook and not all interactivity will work on this website. Right click to download and run locally for full Python-backed interactivity.
Download this notebook from GitHub (right-click to download).