Skip to content

Commit

Permalink
Add basemaps section
Browse files Browse the repository at this point in the history
  • Loading branch information
Robinlovelace committed Aug 28, 2023
1 parent 5feda38 commit cd75407
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion 09-mapping.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,23 @@ To complete...

To complete...

### Basemaps

```{python}
import contextily as ctx
```

```{python}
#| label: fig-basemap
#| fig-cap: Adding a basemap to a static map
nzw = nz.to_crs(epsg=3857)
ax = nzw.plot(figsize=(10, 10), color='none', edgecolor='k')
ctx.add_basemap(ax);
ax2 = nzw.plot(figsize=(10, 10), column='Median_income',
legend=True, alpha=0.5)
ctx.add_basemap(ax2, source=ctx.providers.CartoDB.Positron);
```

### Faceted maps

To complete...
Expand All @@ -150,7 +167,11 @@ To complete...

### GeoPandas explore

...

```{python}
nz.explore()
```

### Layers

Expand Down

0 comments on commit cd75407

Please sign in to comment.