# 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()
# load coordinates of US states in low resolution
states = regions_state('US-48')
#states
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')