[Pythonmac-SIG] charts & graphs

Lance Boyle lanceboyle at cwazy.co.uk
Thu Oct 21 07:01:37 CEST 2004


On Oct 20, 2004, at 5:58 AM, Marcus Mendenhall wrote:

> Hi,
>
> What are the standard modules that work on mac for making charts and 
> plotting data, etc. I need something that is easy to use, versitle, 
> and WELL DOCUMENTED with examples, tutorials and documentation.
>
> Anyone know a package that fits the bill? Is pil the way to go?
>
> Sorry, i am kind of new to this type of computing and i know mac has 
> it's own graphics issues..
>
>
> -kevin
>
Someone should probably put together an annotated list of 
Python-appropriate plotting options, since this gets asked a lot (I 
suppose).

Consider R at www.r-project.org, and don't be put off if statistics 
isn't your main thing. R is a general purpose environment and might 
even ease your need to use Python for technical stuff 8^).

And there's the on-going Chaco project.

Gnuplot with AquaTerm is pretty nice and simple. (Someone else 
mentioned it but I'll mention it again.) Here's a program (not mine) 
that pretty much makes the entire gnuplot language available in Python.



import os
class gnuplot:
	def __init__(self):
		print "opening new gnuplot session..."
		self.session = os.popen("gnuplot","w")
	def __del__(self):
		print "closing gnuplot session..."
		self.session.close()
	def send(self, cmd):
		self.session.write(cmd+'\n')
		self.session.flush()
if __name__=="__main__":
	g1 = gnuplot()
	g1.send("set terminal aqua 0")
	
	# Your code here
	g1.send("plot sin(x)")
	
	del g1


Jerry



More information about the Pythonmac-SIG mailing list