Skip to content

Commit

Permalink
refactor: alter chart x-axis; sci notation for precip; incr event limit
Browse files Browse the repository at this point in the history
  • Loading branch information
dtbuchholz committed Feb 23, 2024
1 parent 660ba45 commit 44e8b87
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion basin_wxm/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def get_vault_events(vault: str, start: int | None, end: int | None) -> List[Dic
# objects that contain the CID and other metadata
try:
url = f"https://basin.tableland.xyz/vaults/{vault}/events"
params = {"after": start, "before": end, "limit": 50}
params = {"after": start, "before": end, "limit": 1000}
response = get(url, params)

if response.status_code == 200:
Expand Down
9 changes: 6 additions & 3 deletions basin_wxm/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,14 @@ def write_history_plots(root: Path, exclude_cols: List[str]) -> None:
plt.ylabel(col)
# Set date format on x-axis
plt.gca().xaxis.set_major_formatter(mdates.DateFormatter("%Y-%m-%d"))
plt.gca().xaxis.set_major_locator(mdates.DayLocator())
plt.gca().xaxis.set_major_locator(mdates.DayLocator(interval=7))
plt.gcf().autofmt_xdate()
# Format y-axis to use fixed-point notation with one decimal
# Format y-axis to use fixed-point notation with two decimals
ax = plt.gca() # Get the current axis
ax.yaxis.set_major_formatter(ticker.FormatStrFormatter("%.2f"))
if col == "total_precipitation":
ax.yaxis.set_major_formatter(ticker.FormatStrFormatter("%.2e"))
else:
ax.yaxis.set_major_formatter(ticker.FormatStrFormatter("%.2f"))
plt.grid(True)

# Ensure the directory exists
Expand Down

0 comments on commit 44e8b87

Please sign in to comment.