I misinterpreted the question about legends on graphs. Here is an example
(which incidentally also illustrates a feature, new in VPython for Python
2.2, that permits multiline labels):
from visual.graph import *
gd = gdisplay(xmax=10, ymax=5)
legend = label(display=gd.display, pos=(5,4), text='This is a\nlegend')
The point is that a gdisplay has a "display" attribute (here, gd.display),
so you can display any Visual object you like.
Bruce
|