因为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'])
Run Code Online (Sandbox Code Playgroud)