Class Plot
source code
object --+
|
Plot
A simple graphical tool for plotting functions. Each new
Plot
object opens a new window, containing the plot for a
sinlge function. Multiple plots in the same window are not (yet)
supported. The Plot
constructor supports several mechanisms
for defining the set of points to plot.
Example plots
Plot the math.sin function over the range [-10:10:.1]:
>>> import math
>>> Plot(math.sin)
Plot the math.sin function over the range [0:1:.001]:
>>> Plot(math.sin, slice(0, 1, .001))
Plot a list of points:
>>> points = ([1,1], [3,8], [5,3], [6,12], [1,24])
>>> Plot(points)
Plot a list of values, at x=0, x=1, x=2, ..., x=n:
>>> Plot(x**2 for x in range(20))
|
|
|
|
|
|
|
|
|
about(self,
*e)
Dispaly an 'about' dialog window for the NLTK plot tool. |
source code
|
|
|
|
|
postscript(self,
*e)
Print the (currently visible) contents of the plot window to a
postscript file. |
source code
|
|
|
destroy(self,
*args)
Cloase the plot window. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__str__
|
Inherited from object :
__class__
|
__init__(self,
vals,
rng=None,
**kwargs)
(Constructor)
| source code
|
Create a new Plot .
- Parameters:
- Overrides:
object.__init__
|
Enter the mainloop for the window. This method must be called if a
Plot is constructed from a non-interactive Python program (e.g., from a
script); otherwise, the plot window will close as soon se the script
completes.
|