World population

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

gv.extension('matplotlib')
%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]:
%%opts Points (s=0.00001 cmap='viridis') [tools=['hover'] size_index=2 color_index=2] WMTS [zoom=0]
(tiles * points).redim.range(Longitude=(-180, 180), Latitude=(-85, 85))
Out[3]:

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