You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: book/tut01_firstfigure.ipynb
+4-13
Original file line number
Diff line number
Diff line change
@@ -142,7 +142,7 @@
142
142
"1. `region`: Controlling the geographic or Cartesian extent of the figure. Regions are specified as lists of `[xmin, xmax, ymin, ymax]`. Another shortcut, `region=\"g\"`, which specifies a **global** domain.\n",
143
143
"2. `projection`: Controlling the map projection. GMT (and therefore PyGMT) supports 31 different map projections, from basic Cartesian axes to [arbitrary vertical perspectives](https://docs.generic-mapping-tools.org/6.5/gallery/ex26.html).\n",
144
144
"\n",
145
-
"> Determining the size of your images `10c`, the size will affect how large of your following fontsize and markersize\n",
145
+
"> Determining the size of your images `10c`, the size will affect how large of your following font size and marker size\n",
146
146
">> **length unit** `c`: centimeter (default)\n",
147
147
"\n",
148
148
"> More projections please click https://www.pygmt.org/v0.13.0/projections/index.html"
Copy file name to clipboardexpand all lines: book/tut02_spe_pd_gpd.ipynb
+4-4
Original file line number
Diff line number
Diff line change
@@ -183,7 +183,7 @@
183
183
"source": [
184
184
"### 1.3 Create a geographical map showing the epicenters (scatter plot)\n",
185
185
"\n",
186
-
"Now it's time to create a geographical map showing the earthquakes. You can start with using [`pygmt.Figure.basemap`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.basemap.html) and [`pygmt.Figure.coast`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.coast.html) to set up the map. To create a scatter plot we can pass appropriate columns of the `pandas.DataFrame` to the `x`, `y`, `size`, and `fill` parameters of [`pygmt.Figure.plot`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.plot.html). This allows use to plot the epicenters as size (moment magnitude) and color (hypocentral depth) coded circles on top of the map. For details you can have a look at [**Plotting data points**](https://www.pygmt.org/v0.13.0/tutorials/basics/plot.html)."
186
+
"Now it's time to create a geographical map showing the earthquakes. You can start with using [`pygmt.Figure.basemap`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.basemap.html) and [`pygmt.Figure.coast`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.coast.html) to set up the map. To create a scatter plot we can pass appropriate columns of a `pandas.DataFrame` to the `x`, `y`, `size`, and `fill` parameters of [`pygmt.Figure.plot`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.plot.html). This allows us to plot the epicenters as size (moment magnitude) and color (hypocentral depth) coded circles on top of the map. For details you can have a look at [**Plotting data points**](https://www.pygmt.org/v0.13.0/tutorials/basics/plot.html)."
187
187
]
188
188
},
189
189
{
@@ -229,7 +229,7 @@
229
229
"source": [
230
230
"### 2.1 Line geometry\n",
231
231
"\n",
232
-
"Features which can be represented as a **line geometry** are for example rivers, roads, national boundaries, shorlines, and any kind of profiles."
232
+
"Features which can be represented as a **line geometry** are for example rivers, roads, national boundaries, shorelines, and any kind of profiles."
233
233
]
234
234
},
235
235
{
@@ -397,7 +397,7 @@
397
397
"source": [
398
398
"#### 2.2.1 Spatial Data - `geopandas.GeoDataFrame` with polygon geometry\n",
399
399
"\n",
400
-
"Again we download some data into in a [`geopandas.GeoDataFrame`](https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.html). This dataset contains information regarding airbnb rentals, socioeconomics, and crime in Chicagos.\n",
400
+
"Again we download some data into in a [`geopandas.GeoDataFrame`](https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.html). This dataset contains information regarding airbnb rentals, socioeconomics, and crime in Chicago.\n",
401
401
"This time we are lucky and the data is directly provided in the geographic coordinate reference system (longitude/latitude) and no coordinate transformation is needed."
402
402
]
403
403
},
@@ -476,7 +476,7 @@
476
476
"Some helpful and interesting aspects:\n",
477
477
"\n",
478
478
"- Use suitable colormaps for your data: [**Scientific colourmaps by Fabio Crameri**](https://www.fabiocrameri.ch/colourmaps/), see also the publications [Crameri et al. 2024](https://doi.org/10.1002/cpz1.1126) and [Crameri et al. 2020](https://doi.org/10.1038/s41467-020-19160-7)\n",
479
-
"- Datasets provided by `GeoPandas`: Checkout the [**geodatasets**](https://geodatasets.readthedocs.io) libaray\n",
479
+
"- Datasets provided by `GeoPandas`: Checkout the [**geodatasets**](https://geodatasets.readthedocs.io) library\n",
480
480
"- Convert other objects to `pandas` or `GeoPandas` objects to make them usable in `PyGMT`: For example, convert [**OSMnx**](https://osmnx.readthedocs.io)'s `MultiDiGraph` to a `geopandas.DataFrame`\n",
481
481
"- Create more complex geometries: Combine `GeoPandas` with [**shapely**](https://shapely.readthedocs.io) (i.e., `from shapely.geometry import Polygon`)\n",
482
482
"- Support of OGR formats: Use [`geopandas.read_file`](https://geopandas.org/en/v1.0.1/docs/reference/api/geopandas.read_file.html) to load data provided as shapefile (.shp), GeoJSON (.geojson), geopackage (.gpkg), etc."
"[`pygmt.project`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.project.html) is designed to sample points along a great circle, a straight line, or across specified distance. In our case, we will create a profile point-to-point. Therefore you need to define: \n",
282
+
"[`pygmt.project`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.project.html) is designed to sample points along a great circle, a straight line, or across specified distance. In our case, we will create a profile point-to-point. Therefore, you need to define: \n",
283
283
"\n",
284
284
"1. `center` and `endpoint`: Specify the start and end coordinates of the profile.\n",
285
285
"2. `generate`: Distance interval of each point, e.g., `10` means points are generated every 10 degrees along the profile. \n",
Copy file name to clipboardexpand all lines: book/tut06_animation.rst
+17-16
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,11 @@
1
-
**Tutorial 6** - Animations with GMT
2
-
------------------------------------
1
+
**Tutorial 6** - Animations with GMT 🎦
2
+
---------------------------------------
3
3
4
4
Content
5
-
- This tutorial explains the basic aspect of doing animations with GMT.
6
-
- It serves as a guide to help beginners understand and troubleshoot potential issues.
7
-
- It explains the basic aspect of the :gmt-module:`movie` and :gmt-module:`events` modules.
5
+
6
+
* This tutorial explains the basic aspect of doing animations with GMT.
7
+
* It serves as a guide to help beginners understand and troubleshoot potential issues.
8
+
* It explains the basic aspect of the :gmt-module:`movie` and :gmt-module:`events` modules.
8
9
9
10
.. note::
10
11
This tutorial is part of the AGU24 annual meeting GMT/PyGMT pre-conference workshop (PREWS9) **Mastering Geospatial Visualizations with GMT/PyGMT**
@@ -22,8 +23,8 @@ Content
22
23
Fee free to play around with these code examples 🚀. In case you found any kind of error, just report it by `opening an issue <https://github.com/GenericMappingTools/agu24workshop/issues>`_ or `provide a fix via a pull request <https://github.com/GenericMappingTools/agu24workshop/pulls>`_. Please use the `GMT forum <https://forum.generic-mapping-tools.org/>`_ to ask questions.
23
24
24
25
25
-
1. Introduction
26
-
~~~~~~~~~~~~~~~
26
+
1️⃣. Introduction
27
+
~~~~~~~~~~~~~~~~~
27
28
28
29
Prior to GMT 6.0, ambitious movie makers had to write complicated scripts where the advancement of frames was explicitly done by a shell loop.
29
30
At the end of the script, you would have to convert your PostScript plot to a raster image with a name that is lexically increasing,
@@ -80,8 +81,9 @@ For the purposes of this tutorial, I define two types of animations that can be
80
81
- GMT version 6.5 or later.
81
82
- Bash scripting environment: The examples in this tutorial are written in Bash and may not work correctly in other shell environments (e.g., zsh, fish, or Windows cmd).
82
83
83
-
2. Tutorial 1. Earth spinning
84
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
84
+
85
+
2️⃣. Tutorial 1. Earth spinning
86
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
85
87
86
88
Here I explain how to make an animation of a moving object which only requires the :gmt-module:`movie` module.
87
89
@@ -496,17 +498,16 @@ In the step, I increase:
496
498
Also you could use `-x <https://docs.generic-mapping-tools.org/6.5/gmt.html#core-full>`_ to specify the number of active cores to be used.
497
499
498
500
499
-
3. Tutorial 2. Earthquakes
500
-
~~~~~~~~~~~~~~~~~~~~~~~~~~
501
+
3️⃣. Tutorial 2. Earthquakes
502
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
501
503
502
504
Check the extended section to see the tutorial 2 about appearing objects.
503
505
That type of animation is more complex and requires the use :gmt-module:`events` and :gmt-module:`movie` modules.
504
506
In that tutorial, I create an animation showing the occurrences of earthquakes during the year 2018 (with one frame per day).
505
507
506
508
507
-
508
-
4. See also
509
-
~~~~~~~~~~~
509
+
4️⃣. See also
510
+
~~~~~~~~~~~~~
510
511
511
512
- The paper about animations which include explanation and examples (`Wessel et al. 2024 <https://doi.org/10.1029/2024GC011545>`_).
512
513
@@ -515,8 +516,8 @@ In that tutorial, I create an animation showing the occurrences of earthquakes d
515
516
- See the `GMT animation gallery <https://docs.generic-mapping-tools.org/6.5/animations.html>`_ for more examples.
516
517
517
518
518
-
5. References
519
-
~~~~~~~~~~~~~
519
+
5️. References
520
+
~~~~~~~~~~~~~~~
520
521
521
522
- Wessel, P., Luis, J. F., Uieda, L., Scharroo, R., Wobbe, F., Smith, W. H. F., & Tian, D. (2019). The Generic Mapping Tools Version 6. Geochemistry, Geophysics, Geosystems, 20(11), 5556–5564. https://doi.org/10.1029/2019GC008515
522
523
- Wessel, P., Esteban, F., & Delaviel-Anger, G. (2024). The Generic Mapping Tools and animations for the masses. Geochemistry, Geophysics, Geosystems, 25, e2024GC011545. https://doi.org/10.1029/2024GC011545.
This tutorial is part of the AGU24 annual meeting GMT/PyGMT pre-conference workshop (PREWS9) **Mastering Geospatial Visualizations with GMT/PyGMT**
@@ -21,8 +22,8 @@ Content
21
22
22
23
Fee free to play around with these code examples 🚀. In case you found any kind of error, just report it by `opening an issue <https://github.com/GenericMappingTools/agu24workshop/issues>`_ or `provide a fix via a pull request <https://github.com/GenericMappingTools/agu24workshop/pulls>`_. Please use the `GMT forum <https://forum.generic-mapping-tools.org/>`_ to ask questions.
23
24
24
-
3. Tutorial 2. Earthquakes
25
-
~~~~~~~~~~~~~~~~~~~~~~~~~~
25
+
3️. Tutorial 2. Earthquakes
26
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26
27
27
28
Here I explain how to make an animation with appearing objects.
28
29
This is more complex and requires the use :gmt-module:`events` and :gmt-module:`movie` modules.
@@ -419,8 +420,8 @@ The plateau phase is not used.
419
420
- -Mi1+c0: modify the intensity of the color. It gets lighter during the rise phase and then returns to its original color in the coda phase.
420
421
421
422
422
-
4. See also
423
-
~~~~~~~~~~~
423
+
4️⃣. See also
424
+
~~~~~~~~~~~~~
424
425
425
426
- The paper about animations which include explanation and examples (`Wessel et al. 2024 <https://doi.org/10.1029/2024GC011545>`_).
426
427
@@ -429,8 +430,8 @@ The plateau phase is not used.
429
430
- See the `GMT animation gallery <https://docs.generic-mapping-tools.org/6.5/animations.html>`_ for more examples.
430
431
431
432
432
-
5. References
433
-
~~~~~~~~~~~~~
433
+
5️⃣. References
434
+
~~~~~~~~~~~~~~~
434
435
435
436
- Wessel, P., Luis, J. F., Uieda, L., Scharroo, R., Wobbe, F., Smith, W. H. F., & Tian, D. (2019). The Generic Mapping Tools Version 6. Geochemistry, Geophysics, Geosystems, 20(11), 5556–5564. https://doi.org/10.1029/2019GC008515
436
437
- Wessel, P., Esteban, F., & Delaviel-Anger, G. (2024). The Generic Mapping Tools and animations for the masses. Geochemistry, Geophysics, Geosystems, 25, e2024GC011545. https://doi.org/10.1029/2024GC011545.
0 commit comments