googlecolab / colabtools

Python libraries for Google Colaboratory
Apache License 2.0
2.2k stars 724 forks source link

NLTK dispersion plot not displaying the graph #397

Closed specbug closed 1 year ago

specbug commented 5 years ago

NLTK dispersion plot for a text, as displayed here , only seems to plot the axis and labels and doesn't plot the actual dispersion data points in the graph ,as shown in the figure below.

image

alex-orlovskyi commented 5 years ago

Same

InonS commented 3 years ago

@specbug have you been able to use other NLTK plots, such as draw()? I am just getting the TclError: no display name and no $DISPLAY environment variable and would be happy to know how to work around it

metrizable commented 1 year ago

Working through the NLTK examples from here, I'm able to produce the Lexical Dispersion plot:

64rcS6guGUkYqhC

Since this issue was filed a while ago, if you are still experiencing the issue, please open a new bug and provide a minimal reproducible notebook there.

ShakaAmilcar876 commented 2 months ago

Could someone please say how this issue was fixed? I cannot get the dispersion plot to display. My code follows: `import nltk import matplotlib from nltk.book import * from nltk.draw.dispersion import dispersion_plot

text1.concordance("survived") text2.similar("monstrous") text2.common_contexts(["monstrous", "very"]) text4.dispersion_plot(["citizens", "democracy", "freedom", "duties", "America"]) ` I do not understand what is going wrong. Is it that the plot is printing but is printing too fast to be seen? If so, is there a way to keep the plot onscreen? Has the function changed somehow? Anyone have any insights about this?