From 86cef45f1bde7877c98fde501ac2a3801e5e801a Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Wed, 17 Dec 2025 16:38:02 +0800 Subject: [PATCH] Figure 2: Update Figure.logo to the Pythonic syntax --- Fig2_PyGMT_ecosystem.ipynb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Fig2_PyGMT_ecosystem.ipynb b/Fig2_PyGMT_ecosystem.ipynb index bb8705d7..f99d7210 100644 --- a/Fig2_PyGMT_ecosystem.ipynb +++ b/Fig2_PyGMT_ecosystem.ipynb @@ -8,6 +8,7 @@ "outputs": [], "source": [ "import pygmt\n", + "from pygmt.params import Position\n", "\n", "red, blue = \"238/86/52\", \"#4B8BBE\" # GMT red and Python blue\n", "\n", @@ -25,7 +26,7 @@ " text=[\"GMT low-level\", \"library\", \"GMT C API\", \"GMT modules\"] ,\n", " font=\"8p,1,white\",\n", ")\n", - "fig.logo(position=\"g1/6.95+jMC+w2.15c\")\n", + "fig.logo(position=Position((1, 6.95), cstype=\"mapcoords\", anchor=\"MC\"), width=\"2.15c\")\n", "\n", "# Add the Python part.\n", "fig.plot(x=[7.5, 15.5, 15.5, 7.5], y=[0, 0, 6, 6], pen=f\"2p,{blue}\", fill=f\"{blue}@70\", close=True)\n", @@ -72,6 +73,14 @@ "fig.show()\n", "fig.savefig(\"Fig2_PyGMT_ecosystem.png\")" ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "09fcce02", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { @@ -90,7 +99,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.7" + "version": "3.12.8" } }, "nbformat": 4,