Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions Fig4_PyGMT_pandas.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"import pandas as pd\n",
"import pygmt\n",
"import requests\n",
"from pygmt.params import Box\n",
"from pygmt.params import Box, Position\n",
"\n",
"params = {\n",
" \"format\": \"csv\",\n",
Expand Down Expand Up @@ -50,10 +50,15 @@
"legend = io.StringIO(\n",
" \"\\n\".join(f\"S 0.4 c {0.005 * 2**mag:.2f} - 1p 1 M {mag}\" for mag in [5, 6, 7])\n",
")\n",
"fig.legend(spec=legend, position=\"jBR+o0.2c+l2\", box=Box(fill=\"white\", pen=\"black\"))\n",
"fig.legend(\n",
" spec=legend,\n",
" position=Position(\"BR\", offset=0.2),\n",
" box=Box(fill=\"white\", pen=\"black\"),\n",
" line_spacing=2,\n",
")\n",
"\n",
"# Add histogram for magnitude distribution\n",
"with fig.inset(position=\"jBL+w7c/4c+o0.2c\", margin=(1.3, 0.2, 1.1, 0.2), box=True):\n",
"with fig.inset(position=\"jBL+w7c/4c+o0.2c\", clearance=(1.3, 0.2, 1.1, 0.2), box=True):\n",
" fig.histogram(\n",
" region=[4.8, 9.2, 0, 0],\n",
" projection=\"X?/?\",\n",
Expand All @@ -71,7 +76,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "pygmt",
"language": "python",
"name": "python3"
},
Expand All @@ -85,7 +90,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
"version": "3.13.9"
}
},
"nbformat": 4,
Expand Down