Laney Mills wrote:
Hi Bruce, Gary has helped me with a couple of Python questions. Since
you use VPython a lot, do you know how to adjust the dot size for
vpython 2d plots. I want to make the Mandelbrot set, which needs the
highest resolution I can get, one pixel per dot if possible. I think
the control of dot size is done deep down in some library function
called by vpython. I was just hoping you had seen how to make that
happen. From within vpython, the minium dot size is much larger than
one pixel. Otherwise, vpython is perfect for the job.
Thanks,
Laney Mills,
College of Charleston
------------------------------
I replied:
Unfortunately there isn't currently any simple way to do that. The
module in question is graph.py (invoked by importing visual.graph),
which I wrote (on Windows, it is in
C:\Python24\Lib\site-packages\visual). For dots it uses a lower-case
text "o" because a graph typically has different x and y scales, so any
of the standard Visual objects wouldn't be dot-like, including a small
sphere (which would typically end up being an ellipsoid).
I would however think that for something like the Mandelbrot set there's
no good reason to use visual.graph at all; just use a standard VPython
window and plot very small spheres (though in any case you may run into
problems rendering a very large number of objects).
If for some reason you want to use visual.graph, you could modify it to
plot small spheres instead of o's, since you may well have uniform axes
(same x and y scales).
Bruce Sherwood
(And later Mills raised the possibility of using the Python Imaging
Library, which might indeed be the appropriate tool for this project.)
|