Esempio n. 1
0
    max_words=500,

    #设置停用词
    stopwords=stopwords,

    #设置词云中的最大字号
    max_font_size=84,

    #设置词云中的最小字号
    #min_font_size=16,

    #指定词云的模板对象
    mask=maskImg,
    random_state=42)
#设置字云字体
my_wordcloud.front_path = 'msyh.ttf'

#根据文本创建词云对象
my_wordcloud.generate(text)

#生成字云
#my_wordcloud.generate_from_text(wl_space_split)

#根据图片创建着色对象
#img_colors = ImageColorGenerator(maskImg)

#使用着色对象对调整词云对象颜色
#my_wordcloud.recolor(color_func=img_colors)

###Main Fig Object and Setting
fig = plt.figure(figsize=(6, 8), facecolor="grey")