GPT回复的信息是2022年2月之前的WordCloud,反复告诉我不能在WordCloud.add()里设置图片大小;后来查了API,发现GPT的信息也老了……
以下两种方法可以参考:
方法一:
#需要导入options
from pyecharts import options as opts
from pyecharts.charts import WordCloud
#初始化图标尺寸
WordCloud(init_opts=opts.InitOpts(width="800px", height="500px"))
方法二:
参考pyecharts的API
pyecharts - A Python Echarts Plotting Library built with love.
WordCloud.add()里,直接可以使用 width = '200px', height = '400px’ 来设置词云图map的大小。