from math import sqrt
import numpy as np
import pandas as pd
from lets_plot import *
LetsPlot.setup_html()
lon_min, lon_max = -106.65, -93.51
lat_min, lat_max = 0.0, 80.0
num_points = 1000
data = {
'lon': np.random.uniform(lon_min, lon_max, num_points),
'lat': np.random.uniform(lat_min, lat_max, num_points),
}
df = pd.DataFrame(data)
df
lon | lat | |
---|---|---|
0 | -105.034633 | 78.748055 |
1 | -101.615036 | 65.380899 |
2 | -98.732629 | 77.097753 |
3 | -98.301155 | 45.695936 |
4 | -97.060510 | 40.132365 |
... | ... | ... |
995 | -101.042225 | 14.729542 |
996 | -105.197533 | 53.561185 |
997 | -99.378842 | 45.659620 |
998 | -104.275221 | 39.222438 |
999 | -105.415288 | 49.439561 |
1000 rows × 2 columns
ggplot(df, aes('lon', 'lat')) + geom_livemap() + geom_hex(binwidth=[2, 2])
ggplot(df, aes('lon', 'lat')) + geom_livemap(projection = 'conic') + geom_hex(binwidth=[2, 2])
#dump_plot(_)