python - NLTK离散度图尺寸

标签 python plot nltk

如何更改nltk分散图()中的图形大小?

这是我在下面绘制的一个示例:

enter image description here

最佳答案

因为nltk使用matplotlib,所以可以对figsize进行简单的更改:

import matplotlib.pyplot as plt
plt.figure(figsize=(20, 8))  # change figsize to (width, height), the size you want

# rest of code...
text1.dispersion_plot(['somehow', 'year', 'what'])

关于python - NLTK离散度图尺寸,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42848307/

相关文章:

r - 螺旋环绕的文本

R 避免 x 轴自动缩放为 10 的幂

python - 嵌入绘图主窗口中的双绘图

python - 循环遍历字符串项列表并返回那些包含 python 子字符串的项

python - 使用python从txt文件中提取单词

python - 如何从 Doc 对象生成 .conllu?

python - 何时使用 pandas 系列、numpy ndarrays 或简单的 python 字典?

python - 数字输出有时有.0

python - 如何将颜色条添加到已经存在的图形中?

python - 问 : Python Spell Checker using NLTK