Graphing with Python?

Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jan 2008
Posts: 10
Reputation: linkrulesx10 is an unknown quantity at this point 
Solved Threads: 0
linkrulesx10 linkrulesx10 is offline Offline
Newbie Poster

Graphing with Python?

 
0
  #1
Mar 26th, 2008
I am undergoing a school project, which is a projectile calculator and graphing.
Now I do not want any code or tips or anything as I think I am going well however one issue I am unable to resolve is how to generate a graph.

I have spent an hour or two googling python graphers and python plotters etc... came across a program called pyplotlib however I was unable to get it to work and was citing something called numpy was missing from a line. (I was using a sample code that was on the website so it should be error free)

Anyway essentially I need a way to generate graphs in Python, Any links to good websites, program links and tutorial links would be appreciated.

I know it is a bit rude that my first post on a forum to be a plee for help, but to be honest I really have not got much to offer to other people who ask for help so please excuse my rudeness.
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 311
Reputation: BearofNH is on a distinguished road 
Solved Threads: 40
BearofNH's Avatar
BearofNH BearofNH is offline Offline
Posting Whiz

Re: Graphing with Python?

 
0
  #2
Mar 26th, 2008
I use pyplotlib and found it pretty easy to copy the example code. Actually I did have to do a lot of repititions of trying different things until I got the desired results, but overall it was OK, definitely worth the effort.

Yes it requires numpy but you can find that too.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 138
Reputation: a1eio is an unknown quantity at this point 
Solved Threads: 21
a1eio's Avatar
a1eio a1eio is offline Offline
Junior Poster

Re: Graphing with Python?

 
0
  #3
Mar 26th, 2008
Hi,

download numpy here: http://sourceforge.net/project/showf...kage_id=175103

download matplotlib here:
http://sourceforge.net/project/showf...ckage_id=82474

install both and you should be set to go,
drawing a simple graph and displaying it is as simple as:
  1. >>> from pylab import *
  2. >>> plot([1,2,3,4])
  3. [<matplotlib.lines.Line2D instance at 0x01A34BC0>]
  4. >>> show()
Obviously you can do a lot more than that, there is a pretty good tutorial on using it here:
http://matplotlib.sourceforge.net/tutorial.html
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 666
Reputation: ZZucker is on a distinguished road 
Solved Threads: 38
ZZucker's Avatar
ZZucker ZZucker is offline Offline
Practically a Master Poster

Re: Graphing with Python?

 
0
  #4
Mar 26th, 2008
Vega left a small code snippet about plotting with Tkinter, check:
http://www.daniweb.com/code/snippet578.html
Never argue with idiots, they'll just bring you down to their level and beat you with their experience.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 10
Reputation: linkrulesx10 is an unknown quantity at this point 
Solved Threads: 0
linkrulesx10 linkrulesx10 is offline Offline
Newbie Poster

Re: Graphing with Python?

 
0
  #5
Mar 27th, 2008
Ahk Thanks alot.
Feel a tad silly about not knowing Numpy was a program. I shall got on to playing around with graph functions now so thanks alot people!
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 1,056
Reputation: woooee is a jewel in the rough woooee is a jewel in the rough woooee is a jewel in the rough 
Solved Threads: 298
woooee woooee is offline Offline
Veteran Poster

Re: Graphing with Python?

 
0
  #6
Mar 27th, 2008
Just to be complete, BLT adds graphing to the TCL/Tk toolkit. Use whichever of the suggestions seems best to you. They will all work. http://incrtcl.sourceforge.net/blt/
Last edited by woooee; Mar 27th, 2008 at 3:23 pm.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 1,546
Reputation: Ene Uran has a spectacular aura about Ene Uran has a spectacular aura about 
Solved Threads: 174
Ene Uran's Avatar
Ene Uran Ene Uran is offline Offline
Posting Virtuoso

Re: Graphing with Python?

 
0
  #7
Mar 27th, 2008
Originally Posted by woooee View Post
Just to be complete, BLT adds graphing to the TCL/Tk toolkit. Use whichever of the suggestions seems best to you. They will all work. http://incrtcl.sourceforge.net/blt/
The only caveat, you have to program in TCL, not Python.
drink her pretty
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 1,056
Reputation: woooee is a jewel in the rough woooee is a jewel in the rough woooee is a jewel in the rough 
Solved Threads: 298
woooee woooee is offline Offline
Veteran Poster

Re: Graphing with Python?

 
0
  #8
Mar 27th, 2008
The only caveat, you have to program in TCL, not Python.
Sorry, I was assuming too much. I use PMW most of the time and not Tkinter. BLT is available through PMW. For anyone who wants to know if they have BLT installed, you can test for it with the following code, at least on my Ubuntu machine. And installing BLT installs PMW and the python wrappers as well on Ubuntu, so I'm not familiar with a manual install or dependencies. Goolge for pmw.blt if you are interested.
  1. import Tkinter
  2. import Pmw
  3.  
  4. top = Tkinter.Tk()
  5. if not Pmw.Blt.haveblt(top):
  6. print "BLT is not installed!"
  7. else:
  8. print "Good BLT install"
Last edited by woooee; Mar 27th, 2008 at 5:46 pm.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Python Forum
Thread Tools Search this Thread



Tag cloud for Python
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC