= Obsplot(debug=True) op
If using the widget
renderer, debug output will be displayed in JavaScript console. With the jsdom
renderer, it will be displayed directly in the notebook.
Mapping and spatial data
Geo mark
The Geo mark allows to draw geographic features such as points, lines and polygons. These marks data are passed as GeoJSON.
This allows to create choropleth maps such as the following:
-from pyobsplot import Obsplot, Plot
import geopandas as gpd
import pandas as pd
@@ -268,7 +268,7 @@ Geo mark
Of course other marks can be used in conjunction with geo marks. This example represents the density of Walmarts supermarkets and is taken from the Mapping notebook.
-# Load US states from TopoJson with geopandas and convert to GeoJson
= gpd.read_file("data/us-counties-10m.json", layer="states").to_json()
states = gpd.read_file("data/us-counties-10m.json", layer="nation").to_json()
@@ -312,7 +312,7 @@ nation Geo mark
Raster mark
The Raster mark creates an image from spatial data.
Plot allows to do different type of spatial interpolations, such as nearest, which draws voronoi cells around values:
-
+
import polars as pl
= pl.read_csv("data/ca55-south.csv")
@@ -359,7 +359,7 @@ ca55 Raster mark
Or the more recent random walk interpolation:
-
+
"random-walk") flare_map(