Skip to content

Commit 4440791

Browse files
yvonnefroehlichseismanweiji14michaelgrund
authored
Figure 3: Backgroundmaps - coast, remote dataset, tilemap, 3-D - relief of Iceland (#8)
Co-authored-by: Dongdong Tian <seisman.info@gmail.com> Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com>
1 parent a6d7b78 commit 4440791

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

Fig3_PyGMT_backgrounds.ipynb

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"id": "d57cb626-f006-4a23-950d-c673fd04b840",
7+
"metadata": {},
8+
"outputs": [],
9+
"source": [
10+
"import pygmt\n",
11+
"\n",
12+
"region = [-25, -13, 63.2, 66.7]\n",
13+
"\n",
14+
"fig = pygmt.Figure()\n",
15+
"with fig.subplot(\n",
16+
" nrows=2,\n",
17+
" ncols=2,\n",
18+
" subsize=(\"12c\", \"8.5c\"),\n",
19+
" margins=(\"0.3c\", \"0.2c\"),\n",
20+
" frame=\"WSen\",\n",
21+
" sharex=\"b\",\n",
22+
" sharey=\"l\",\n",
23+
" autolabel=\"(a)+o0.15c/0.3c+gwhite@30+v\",\n",
24+
"):\n",
25+
" # Top left\n",
26+
" fig.basemap(region=region, projection=\"M?\", panel=0)\n",
27+
" fig.coast(shorelines=True, land=\"gray\", water=\"lightblue\", resolution=\"high\")\n",
28+
" fig.basemap(map_scale=\"n0.86/0.1+c+w100k+f+l\")\n",
29+
"\n",
30+
" # Bottom left\n",
31+
" fig.tilemap(region=region, projection=\"M?\", zoom=7, panel=1)\n",
32+
"\n",
33+
" # Top right\n",
34+
" grd_relief = pygmt.datasets.load_earth_relief(resolution=\"01m\", region=region)\n",
35+
" fig.basemap(region=region, projection=\"M?\", panel=2)\n",
36+
" fig.grdimage(grid=grd_relief, cmap=\"SCM/oleron\", shading=True)\n",
37+
" fig.colorbar(frame=[\"xa500f250+lElevation\", \"y+lm\"], position=\"JMR\", shading=True)\n",
38+
"\n",
39+
" # Bottom right\n",
40+
" fig.basemap(region=region, projection=\"M?\", perspective=(-150, 25), panel=3)\n",
41+
" fig.grdview(\n",
42+
" grid=grd_relief,\n",
43+
" cmap=\"SCM/oleron\",\n",
44+
" surftype=\"s\",\n",
45+
" shading=True,\n",
46+
" zsize=\"1.5c\",\n",
47+
" plane=\"+ggray\",\n",
48+
" perspective=True,\n",
49+
" )\n",
50+
"fig.show()\n",
51+
"# fig.savefig(\"Fig3_PyGMT_backgrounds.png\")"
52+
]
53+
}
54+
],
55+
"metadata": {
56+
"kernelspec": {
57+
"display_name": "Python 3 (ipykernel)",
58+
"language": "python",
59+
"name": "python3"
60+
},
61+
"language_info": {
62+
"codemirror_mode": {
63+
"name": "ipython",
64+
"version": 3
65+
},
66+
"file_extension": ".py",
67+
"mimetype": "text/x-python",
68+
"name": "python",
69+
"nbconvert_exporter": "python",
70+
"pygments_lexer": "ipython3",
71+
"version": "3.12.3"
72+
}
73+
},
74+
"nbformat": 4,
75+
"nbformat_minor": 5
76+
}

0 commit comments

Comments
 (0)