# from datalore.plot import *
# import datalore.geo_data as gd
from lets_plot import *
from lets_plot.geo_data import *
import pandas as pd
LetsPlot.setup_html()
The geodata is provided by © OpenStreetMap contributors and is made available here under the Open Database License (ODbL).
# load coordinates of US states in low resolution
states = regions_state('US-48')
#states
--------------------------------------------------------------------------- NameError Traceback (most recent call last) C:\Temp/ipykernel_11612/3508414893.py in <module> 1 # load coordinates of US states in low resolution ----> 2 states = regions_state('US-48') 3 #states NameError: name 'regions_state' is not defined
ggplot() + geom_polygon(map=states, alpha=0, color='gray') + ggsize(700, 400)
# Violent Crime Rates by US State
crime_rate = pd.read_csv('https://vincentarelbundock.github.io/Rdatasets/csv/datasets/USArrests.csv')
crime_rate.head()
p = ggplot(crime_rate, aes(fill='Assault'))
p + geom_map(map=states, map_join=["Unnamed: 0", "request"]) + scale_fill_gradient(low='green', high='red')