Skip to content

Commit a91998a

Browse files
authored
Figure 7: Update the Figure.legend syntax (#22)
1 parent b06ee71 commit a91998a

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

Fig7_PyGMT_datetime.ipynb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"import requests\n",
1111
"import pandas as pd\n",
1212
"\n",
13+
"\n",
1314
"def get_star_history(repo):\n",
1415
" owner = \"GenericMappingTools\"\n",
1516
" headers = {\n",
@@ -51,7 +52,7 @@
5152
"\n",
5253
"import pandas as pd\n",
5354
"import pygmt\n",
54-
"from pygmt.params import Box\n",
55+
"from pygmt.params import Box, Position\n",
5556
"\n",
5657
"fig = pygmt.Figure()\n",
5758
"fig.basemap(\n",
@@ -78,7 +79,9 @@
7879
" x=df.index, y=df[\"stars\"], style=f\"{symbol}0.2c\", fill=color, label=wrapper\n",
7980
" )\n",
8081
"fig.legend(\n",
81-
" position=\"jTL+o0.1c+w2.3\", box=Box(fill=\"gray95\", pen=\"0.5p,gray50\", radius=\"3p\")\n",
82+
" position=Position(\"TL\", offset=0.1),\n",
83+
" width=2.3,\n",
84+
" box=Box(fill=\"gray95\", pen=\"0.5p,gray50\", radius=\"3p\"),\n",
8285
")\n",
8386
"\n",
8487
"fig.show()\n",
@@ -88,7 +91,7 @@
8891
],
8992
"metadata": {
9093
"kernelspec": {
91-
"display_name": "Python 3 (ipykernel)",
94+
"display_name": "pygmt",
9295
"language": "python",
9396
"name": "python3"
9497
},
@@ -102,7 +105,7 @@
102105
"name": "python",
103106
"nbconvert_exporter": "python",
104107
"pygments_lexer": "ipython3",
105-
"version": "3.12.3"
108+
"version": "3.13.9"
106109
}
107110
},
108111
"nbformat": 4,

0 commit comments

Comments
 (0)