activity.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:memes-reposter 作者: vaniakosmos 项目源码 文件源码
def visualise(self, marks, counts):
        N = len(marks)
        ind = range(N)

        _, ax = plt.subplots()
        ax.bar(ind, counts, color='#4286f4')

        ax.set_ylabel('Posts')
        ax.set_xticks(ind)
        ax.yaxis.set_major_locator(MaxNLocator(nbins=20, integer=True, min_n_ticks=1))
        step = N // 12 + 1
        labels = [self.format_time(mark) if i % step == 0 else '' for i, mark in enumerate(marks)]
        ax.set_xticklabels(labels, rotation=45, fontsize=10)

        return self.save()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号