Skip to content

Commit

Permalink
grass.jupyter: Add SeriesMap Example to jupyter_tutorial.ipynb (#3472)
Browse files Browse the repository at this point in the history
  • Loading branch information
chaedri committed Mar 4, 2024
1 parent 44ea597 commit dcb41fa
Showing 1 changed file with 49 additions and 1 deletion.
50 changes: 49 additions & 1 deletion doc/notebooks/jupyter_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,54 @@
"elev_map.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Animating Series of Maps\n",
"\n",
"The `SeriesMap` class animates a series of maps. The `ipywidgets` slider allows users to slide between maps and play a continuous loop. This class is similar to the `TimeSeriesMap` class for space-time datasets and shown in the [temporal notebook](./temporal.ipynb)."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!r.slope.aspect elevation=elevation slope=slope"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"series = gj.SeriesMap(height = 500)\n",
"series.add_rasters([\"elevation\", \"elevation_shade\", \"slope\"])\n",
"#series.add_vectors([\"streams\", \"streets\", \"viewpoints\"])\n",
"series.d_vect(map=\"streets\")\n",
"series.d_barscale()\n",
"series.show() # Create Slider"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The series can also be saved as a GIF."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"series.save(\"image.gif\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -466,7 +514,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down

0 comments on commit dcb41fa

Please sign in to comment.