compute.py 文件源码

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

项目:WebAppEx 作者: karlafej 项目源码 文件源码
def get_plot(limit, txt, wc_mask=wc_mask, stop = english_stopwords):
    wordcloud = WordCloud(
        max_words=limit,
        stopwords=stop,
        mask=wc_mask
        ).generate(txt)
    fig = plt.figure()
    fig.set_figwidth(8)
    fig.set_figheight(8)
    plt.imshow(wordcloud, interpolation="bilinear")
    plt.axis('off')

    figfile = BytesIO()
    plt.savefig(figfile, format='png')
    figfile.seek(0) 
    figdata_png = base64.b64encode(figfile.getvalue()).decode()
    return figdata_png
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号