Skip to content

Commit

Permalink
Merge pull request #10 from astropy/plot_format
Browse files Browse the repository at this point in the history
Slightly update plot format
  • Loading branch information
jeffjennings authored Oct 11, 2024
2 parents d860729 + 50a9545 commit 19f5e80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions repo_stats/git_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ def process_commits(self, results, age_recent=90):
bots = [
"dependabot[bot]",
"github-actions",
"github-actions[bot]",
"meeseeksmachine",
"odidev",
"pre-commit-ci[bot]",
Expand Down
10 changes: 6 additions & 4 deletions repo_stats/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
ms = [".", "+", "^", "*", "x", "o"]
cs = ["#ff8300", "#23d361", "#bf177a", "#20c8ed"]

plt.rcParams['font.size'] = 11

now = datetime.now(timezone.utc).strftime("%B %d, %Y")


Expand Down Expand Up @@ -79,13 +81,13 @@ def author_time_plot(commit_stats, repo_owner, repo_name, cache_dir, window_avg=

plt.axhline(0, c="k", ls="--")

plt.xticks(months[::12], rotation=90)
plt.xticks(ticks=months[::12], labels=[x[:4] for x in months[::12]])#, rotation=90)

plt.title(
f"Unique authors of commits to {repo_owner}/{repo_name} (generated on {now})"
)
plt.legend()
plt.xlabel("Date")
plt.xlabel(f"Date ({datetime.strptime(months[0], '%Y-%m').strftime('%B')} of each year)")
plt.ylabel("N")
plt.tight_layout()
plt.savefig(f"{cache_dir}/{repo_name}_authors.png", dpi=300)
Expand Down Expand Up @@ -281,13 +283,13 @@ def issue_PR_time_plot(issue_pr_stats, repo_owner, repo_name, cache_dir, window_
label=f"{labels[i]}: {window_avg} month rolling average",
)

plt.xticks(months[i][::12], rotation=90)
plt.xticks(ticks=months[i][::12], labels=[x[:4] for x in months[i][::12]])#, rotation=90)

plt.title(
f"Issues and PRs opened and closed in {repo_owner}/{repo_name} (generated on {now})"
)
plt.legend(ncol=2)
plt.xlabel("Date")
plt.xlabel(f"Date ({datetime.strptime(months[i][0], '%Y-%m').strftime('%B')} of each year)")
plt.ylabel("N")
plt.tight_layout()
plt.savefig(f"{cache_dir}/{repo_name}_issues_PRs.png", dpi=300)
Expand Down

0 comments on commit 19f5e80

Please sign in to comment.