[Tutor] small (I hope) questions

Stephen L Arnold sarnold@earthling.net
Mon, 4 Jun 2001 19:54:47 -0700


On 4 Jun 01, at 14:25, Isaac Hall wrote:

[snip]
> a) I am trying to produce a pie chart of just random numbers in
> a list to get started with this, however Im confused as to how to
> call up a canvas, and draw the chart. 
[snip]

Are you sure you want to code this yourself, as opposed to calling 
a graphics lib or using an external app?  I think the WXPython 
package comes with a basic plotting lib.  I know gnuplot works well 
with Python, and a windows version even comes with the ActiveState 
Python (gnuplot is standard on pretty much every Linux 
distribution).  I've only used gnuplot on Linux, and it works fine; 
I fired up the above windows version and it worked with the demos.  
The gnuplot syntax is pretty straightforward; there's an example on 
one of my cheesy screenshots below (the last one on the page):

http://arnolds.dhs.org/screenshots.html

If you have your data in an ASCII file (in column vectors) then 
from within gnuplot you could plot the second and third columns:

plot "this_file" using 2:3 with linespoints

I never tried a pie chart, but it shouldn't be too hard.

I also saw some cool visualization stuff at the last Python 
conference using VTK, but it's a commercial package (there may be 
something available for download).

Steve