Skip to content

Commit

Permalink
Merge pull request #2 from wxy/wxy-patch-1
Browse files Browse the repository at this point in the history
增加图表标题
  • Loading branch information
wxy authored Oct 9, 2018
2 parents 985ccdb + 2b0e4d7 commit cb7ea77
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions grank/libs/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,10 @@ def generate_top_fig(start_time, end_time, top_number):
else:
break

activity_fig = activity_df.plot().get_figure()
activity_fig = activity_df.plot(title='Activity').get_figure()
activity_fig.savefig("result/activity_line.png")
plt.close(activity_fig)
social_fig = social_df.plot().get_figure()
social_fig = social_df.plot(title='Social').get_figure()
social_fig.savefig("result/social_line.png")
plt.close(social_fig)

Expand All @@ -283,6 +283,7 @@ def generate_repository_fig(start_time, end_time, owner, repository):

fig, ax1 = plt.subplots()
color = 'tab:red'
ax1.set_title(owner + "/" + repository)
ax1.set_xlabel('Time')
ax1.set_ylabel('activity(%.2f)' % all_df['activity'].mean(), color=color)
ax1.plot(all_df['activity'], color=color)
Expand Down

0 comments on commit cb7ea77

Please sign in to comment.