[Pythonmac-SIG] matplotlib

Charles Hartman charles.hartman at conncoll.edu
Mon Nov 2 14:21:40 CET 2009


Many thanks.  Got it all working.  How I would have known that  
dispersion.py was trying to import pylab I can't imagine; it doesn't  
appear anywhere in the traceback.  But now I know and can plot along.   
I will do the NLTK list too.

Charles



>> Traceback (most recent call last):
>>  File "<stdin>", line 1, in <module>
>>  File
>> "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ 
>> site-packages/nltk/text.py",
>> line 452, in dispersion_plot
>>    dispersion_plot(self, words)
>>  File
>> "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ 
>> site-packages/nltk/draw/dispersion.py",
>> line 25, in dispersion_plot
>>    raise ValueError('The plot function requires the matplotlib  
>> package.'
>> ValueError: The plot function requires the matplotlib package.See
>> http://matplotlib.sourceforge.net/
>>>>>
>
> dispersion.py is trying to import pylab. So you could try "import
> pylab" in Python and see what error you get.
> Also you could try and plot something:
> from pylab import plot
> x = range(1)
> plot(x,x)
>
> But I do think either the NLTK or matplotlib mailing lists would be
> more appropriate for you to get help with this.
>
> Also I'd recommend using ipython if you want to work with matplotlib
> plots interactively. It's an interpreter that has much nicer behaviour
> for interactive work.
>
> Cheers
>
> Robin



More information about the Pythonmac-SIG mailing list