In [1]:
import numpy as np
from lets_plot import *
from lets_plot.geo_data import *
LetsPlot.setup_html()
The geodata is provided by © OpenStreetMap contributors and is made available here under the Open Database License (ODbL).
In [2]:
france = geocode_countries(['France'])
germany = geocode_countries(['Germany'])

Simple with scale

In [3]:
(ggplot() + geom_livemap() 
    + geom_label(aes(label='found name'), nudge_y=1, map=france, color='red') 
    + geom_text(aes(label='found name'), nudge_y=1, map=germany, color='#02633e'))
Out[3]:

Without scale

In [4]:
(ggplot() + geom_livemap(const_size_zoomin=0) 
    + geom_label(aes(label='found name'), nudge_y=1, map=france, color='red') 
    + geom_text(aes(label='found name'), nudge_y=1, map=germany, color='#02633e'))
Out[4]:

One step scale

In [5]:
(ggplot() + geom_livemap(const_size_zoomin=1) 
    + geom_label(aes(label='found name'), nudge_y=1, map=france, color='red') 
    + geom_text(aes(label='found name'), nudge_y=1, map=germany, color='#02633e'))
Out[5]:

Empty labels

In [6]:
(ggplot() + geom_livemap() 
    + geom_label(label='', nudge_y=1, map=france, color='red') 
    + geom_text(label='', nudge_y=1, map=germany, color='#02633e'))
Out[6]:

Multiline text

In [7]:
(ggplot() + geom_livemap() 
    + geom_label(label='Exemple d\'un \nlong texte', nudge_y=1, map=france, color='red') 
    + geom_text(label='Beispiel \n eines langen \ntextes', nudge_y=1, map=germany, color='#02633e'))
Out[7]:
In [ ]:
 
In [8]:
(ggplot() + geom_livemap() 
    + geom_label(label='Mit Neigung', angle=90, nudge_y=1, map=france, color='red') 
    + geom_text(label='Avec inclinaison', angle=127, nudge_y=1, map=germany, color='#02633e'))
Out[8]:

With hjust and vjust

In [9]:
(ggplot() + geom_livemap() 
+ geom_point(map=france, color='red') 
+ geom_label(aes(label='found name'), hjust=1, vjust=0, map=france, color='red') 
+ geom_point(map=germany, color='#02633e') 
+ geom_text(aes(label='found name'), hjust=0, vjust=1, map=germany, color='#02633e'))
Out[9]:
In [ ]: