density_mapbox/density_mapbox.rs
1use plotlars::{DensityMapbox, Plot, Text};
2use polars::prelude::*;
3
4fn main() {
5 let data = LazyCsvReader::new(PlRefPath::new("data/us_city_density.csv"))
6 .finish()
7 .unwrap()
8 .collect()
9 .unwrap();
10
11 DensityMapbox::builder()
12 .data(&data)
13 .lat("city_lat")
14 .lon("city_lon")
15 .z("population_density")
16 .center([39.8283, -98.5795])
17 .zoom(3)
18 .plot_title(Text::from("Density Mapbox").font("Arial").size(20))
19 .build()
20 .plot();
21}