World population

In [1]:
import pandas as pd
import geoviews as gv

from geoviews import dim

gv.extension('matplotlib')
gv.output(fig='svg', size=200)

Define data

In [2]:
cities = pd.read_csv('../../assets/cities.csv', encoding="ISO-8859-1")
population = gv.Dataset(cities, kdims=['City', 'Country', 'Year'])
points = population.to(gv.Points, ['Longitude', 'Latitude'], ['Population', 'City', 'Country'])

tiles = gv.tile_sources.Wikipedia

Plot

In [3]:
tiles.opts(zoom=0) * points.opts(
    s=dim('Population')*0.00001, color='Population', cmap='viridis', global_extent=True)
Out[3]:

Download this notebook from GitHub (right-click to download).