Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
ba6f420
Add draft of JN for numpy - array, datatime
yvonnefroehlich Jan 4, 2025
c0b903b
Include output figure
yvonnefroehlich Jan 4, 2025
248a5bd
Reduce resolution of output image in JN
yvonnefroehlich Jan 4, 2025
414c8b8
Include GMT.jl
yvonnefroehlich Jan 5, 2025
c73b38b
Add CSV files [temporary for reference]
yvonnefroehlich Jan 5, 2025
b46752c
Adjust filename
yvonnefroehlich Jan 5, 2025
2150e2a
Reduce resolution of output image in JN
yvonnefroehlich Jan 5, 2025
e525ea6
Fix date in filename
yvonnefroehlich Feb 11, 2025
7434785
Add plot for aligned time series
yvonnefroehlich Apr 23, 2025
9d3fb0d
Update star history data | Reade data from file | Reduce code via loo…
yvonnefroehlich Oct 17, 2025
80cf207
Remove wrong data point
yvonnefroehlich Oct 17, 2025
40bb6ce
Remove unneeded import of numpy
yvonnefroehlich Nov 5, 2025
6853dce
Use upper-case letter for y label
yvonnefroehlich Nov 5, 2025
9188574
Extend x-axis in negative direction to avoid no_clip=True
yvonnefroehlich Nov 5, 2025
37d95e3
Add a box around the legend
yvonnefroehlich Nov 5, 2025
8b22b2f
Remove using no_clip parameter
yvonnefroehlich Nov 5, 2025
abcc381
Fix file
yvonnefroehlich Nov 5, 2025
2550708
Remove date from files for star history
yvonnefroehlich Nov 5, 2025
305321c
Make legend box look nice and use Box class
yvonnefroehlich Nov 5, 2025
331718c
Move to normal python script (temporaly)
yvonnefroehlich Nov 5, 2025
c0ef9ed
Rename files and save output figure
yvonnefroehlich Nov 12, 2025
2ee2822
Merge remote-tracking branch 'origin/main' into fig/numpy
yvonnefroehlich Nov 16, 2025
29a78d5
Adjust figure number
yvonnefroehlich Nov 21, 2025
3118402
Adjust annotations for y axis
yvonnefroehlich Nov 21, 2025
7ab6240
Update starts data csv files
yvonnefroehlich Nov 21, 2025
6aafdce
Update starts data csv files
yvonnefroehlich Nov 21, 2025
38d582d
Add gmtmex
yvonnefroehlich Nov 21, 2025
268dd4b
Sort by starting time of project
yvonnefroehlich Nov 21, 2025
38b04a2
Follow coding style
yvonnefroehlich Nov 27, 2025
81891b2
Merge remote-tracking branch 'origin/main' into fig/numpy
yvonnefroehlich Nov 27, 2025
f9ff990
Merge remote-tracking branch 'origin/main' into fig/numpy
yvonnefroehlich Nov 27, 2025
caa4edc
merge remote-tracking branch 'origin/main' into fig/numpy
yvonnefroehlich Nov 30, 2025
fd86eb7
Import Box class
yvonnefroehlich Nov 30, 2025
79389d5
Fix RGB codes for colors
yvonnefroehlich Dec 1, 2025
c144d8c
Use different symbols
yvonnefroehlich Dec 1, 2025
2e8a472
Test requesting github stars data via Dongdong's code
yvonnefroehlich Dec 1, 2025
73ea374
Merge remote-tracking branch 'origin/main' into fig/numpy
yvonnefroehlich Dec 1, 2025
0018c93
Reorder based y value of laster record
yvonnefroehlich Dec 1, 2025
3da5bff
Adjust color for MATLAB
yvonnefroehlich Dec 2, 2025
8f9dd85
Remove code for old order
yvonnefroehlich Dec 2, 2025
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
35 changes: 35 additions & 0 deletions Fig7_PyGMT_datetime.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "38df9b7b-1835-4ec9-aa00-a85c8b80730e",
"metadata": {},
"outputs": [],
"source": [
"# Copy finale version of script from normal Python file"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Binary file added Fig7_PyGMT_datetime.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions Fig7_PyGMT_datetime.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import requests
import pandas as pd

owner = "GenericMappingTools"
headers = {"Accept": "application/vnd.github.v3.star+json"}

for repo in ["gmt.jl", "pygmt", "gmt", "gmtmex"]:
timestamps = []
page = 1

while True:
r = requests.get(
f"https://api.github.com/repos/{owner}/{repo}/stargazers",
headers=headers,
params={"per_page": 100, "page": page},
)
data = r.json()
if not data:
break

timestamps += [s["starred_at"] for s in data] # full ISO 8601 timestamp
page += 1

timestamps.sort() # ISO strings sort chronologically

df = pd.DataFrame({"timestamp": timestamps})
df["cumulative_stars"] = range(1, len(df) + 1)

print(df)
df.to_csv(f"star_history_github_{repo}.csv", sep=";", index=False)



# %%
import datetime

import pandas as pd
import pygmt
from pygmt.params import Box

stars_step = 20

fig = pygmt.Figure()

fig.basemap(
projection="X12c/6c",
region=[datetime.date(2016, 1, 1), datetime.date(2026, 12, 31), -50, 1000],
frame=["x+lYear", "ya100f50+lGitHub stars"],
)

for wrapper, file, color, symbol in zip(
["GMT", "PyGMT", "GMT.jl", "GMT/MEX"],
["gmt", "pygmt", "gmt.jl", "gmtmex"],
["238/86/52", "48/105/152", "149/88/178", "230/51/51"],
["C", "A", "I", "T"],
strict=False,
):
stars = pd.read_csv(f"star_history_github_{file}.csv", sep=";")
fig.plot(data=stars, pen=color)
fig.plot(data=stars[0:len(stars):stars_step], fill=color, style=f"{symbol}0.2c", label=wrapper)

fig.legend(
position="jTL+o0.1c+w2.3", box=Box(fill="gray95", pen="0.5p,gray50", radius="3p"),
)

fig.show()
fig.savefig(fname="Fig7_PyGMT_datetime.png")
Loading