Skip to content

Commit 7dc30c1

Browse files
committed
Add description for PyGMT scripts and Binder links; Add live notebook for Ch5
1 parent 55dc027 commit 7dc30c1

15 files changed

Lines changed: 1112 additions & 315 deletions

SOURCE_DOCS/basic_concept.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,11 @@ PyGMT 把每張地圖視作一個\ `物件 <https://zh.wikipedia.org/wiki/%E5%AF
200200
201201
在 PyGMT 的使用手冊中,可以找到更詳細的\ `選項對照表格 <https://www.pygmt.org/latest/api/generated/pygmt.Figure.coast.html>`_。
202202

203-
Jupyter Notebook 與 Binder Hub
203+
Jupyter Notebook 與 Binder
204204
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
205+
本教學手冊中使用兩種 PyGMT 腳本的格式。除了傳統的純文字 HTML 語法顯示外,也提供了 `Jupyter Notebook <https://jupyter.org/>`_ 的 Binder 連結。點開 Binder 連結後,伺服器端會安裝一個可以執行 PyGMT 的環境,然後你就可以透過你的網頁瀏覽器執行與修改教學手冊中的 PyGMT 程式碼。本功能目前使用 `MyBinder.org <https://mybinder.org/>`_ 提供、利用 Amazon Web Services 的雲端運算服務讓各位都能免安裝就體驗 PyGMT。歡迎各位多加嘗試!
206+
207+
205208

206209
.. [1] `Taiwan datums <https://wiki.osgeo.org/wiki/Taiwan_datums>`_, OSGeo Wiki.
207210
.. [2] Wessel, P., Luis, J., Uieda, L., Scharroo, R., Wobbe, F., Smith, W. H. F.,

SOURCE_DOCS/coloring_topography.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,32 @@
283283

284284
觀看\ `最終版地圖`_
285285

286+
PyGMT 指令稿
287+
--------------------------------------
288+
289+
使用 PyGMT,可以如下腳本繪製本地圖:
290+
291+
.. code-block:: python
292+
293+
import pygmt
294+
295+
# 取得地形資料
296+
region = [-70.8, -66.56, -17.17, -14.42]
297+
grid = pygmt.datasets.load_earth_relief(resolution='01m', region=region)
298+
299+
# 繪圖
300+
fig = pygmt.Figure()
301+
fig.grdimage(grid, region=region, projection='M6i', cmap='mby.cpt')
302+
fig.coast(rivers='r/0.7p,cornflowerblue', borders='1/0.7p,,--', water='cornflowerblue', frame=['af', '+t"Lago Titicaca"'])
303+
fig.show()
304+
fig.savefig('titicaca_pygmt.png')
305+
306+
你可以使用以下的 Binder 連結嘗試此程式碼:
307+
308+
.. image:: https://mybinder.org/badge_logo.svg
309+
:target: https://mybinder.org/v2/gh/whyjz/GMT-tutorials/HEAD?filepath=SOURCE_DOCS%2Fcoloring_topography%2Ftiticaca_pygmt.ipynb
310+
311+
286312
習題
287313
--------------------------------------
288314

0 commit comments

Comments
 (0)