[BangPypers] 2D plotting libraries.

2010-06-04 Thread Shiv Shankar
Hello,

I have a finite 2 dimensional plane. I have a set of co-ordinates, which is
basically the movement of an object.
The co-ordinates are derived from a set of equations considering various
factors.
After a set of initial research and tryouts i *quickly *decided on using *
pygame* to plot the co-ordinates on a 2D plane.

Has any one in here implemented this sort of a program ? Which library did
you use ? if possible could you explain why you chose the particular
library.


-- shiv
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] 2D plotting libraries.

2010-06-04 Thread Kenneth Gonsalves
On Friday 04 June 2010 12:13:42 Shiv Shankar wrote:
 Has any one in here implemented this sort of a program ? Which library did
 you use ? if possible could you explain why you chose the particular
 library.
 

just started the same thing yesterday!
-- 
Regards
Kenneth Gonsalves
Senior Associate
NRC-FOSS at AU-KBC
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] 2D plotting libraries.

2010-06-04 Thread Noufal Ibrahim
On Fri, Jun 4, 2010 at 12:13 PM, Shiv Shankar fsla...@gmail.com wrote:
 Hello,

 I have a finite 2 dimensional plane. I have a set of co-ordinates, which is
 basically the movement of an object.
 The co-ordinates are derived from a set of equations considering various
 factors.
 After a set of initial research and tryouts i *quickly *decided on using *
 pygame* to plot the co-ordinates on a 2D plane.

PyGame is better if you want to animate rather than to plot. It has an
animation loop inside which you can update sprites and things. If you
want to see your object move as per your equations, it's pretty easy
to do. I have an example program here which you can customise.
http://github.com/nibrahim/Devious-machinations/blob/master/tutorials/positioning_sprites.py

You'll have to change the update method of the Ball to set the x and y
based on your equations rather than just x+=2, y+=0.5 which I've done.


 Has any one in here implemented this sort of a program ? Which library did
 you use ? if possible could you explain why you chose the particular
 library.

If I wanted to plot, I'd write the program to dump out the X and Y
coordinates in plain text and pipe that through Gnuplot after some
massaging to do the plot.
If you want to stuff the whole thing in Python, you simply use a
Tkinter canvas. It has some simple primitives to draw points at x and
y positions. Should be doable in 10 or 15 lines of code.




-- 
~noufal
http://nibrahim.net.in
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] 2D plotting libraries.

2010-06-04 Thread Anand Chitipothu
2010/6/4 Shiv Shankar fsla...@gmail.com:
 Hello,

 I have a finite 2 dimensional plane. I have a set of co-ordinates, which is
 basically the movement of an object.
 The co-ordinates are derived from a set of equations considering various
 factors.
 After a set of initial research and tryouts i *quickly *decided on using *
 pygame* to plot the co-ordinates on a 2D plane.

 Has any one in here implemented this sort of a program ? Which library did
 you use ? if possible could you explain why you chose the particular
 library.

If that is not an animation, you can use Python Imaging Library to
render the graph as an image.

Here is a sample code for rendering sparklines.

http://github.com/aaronsw/watchdog/blob/master/utils/simplegraphs.py

Anand
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] 2D plotting libraries.

2010-06-04 Thread Anand Balachandran Pillai
On Fri, Jun 4, 2010 at 12:13 PM, Shiv Shankar fsla...@gmail.com wrote:

 Hello,

 I have a finite 2 dimensional plane. I have a set of co-ordinates, which is
 basically the movement of an object.
 The co-ordinates are derived from a set of equations considering various
 factors.
 After a set of initial research and tryouts i *quickly *decided on using *
 pygame* to plot the co-ordinates on a 2D plane.


 Wrong choice. When a software exists which is the perhaps the most
powerful plotting program *ever* written, choosing a gaming library
for this demonstrates poor choice, unless there is a specific reason
 for that - like for example, if you are already familiar with Pygame or
 SDL.

I am talking about gnuplot here.

The commands are pretty intuitive. It gives you an interactive
prompt, like python. For example, here is how to plot
a curve for the function (3*x*x - 8*x) over x range of -50:50
and y-range of -10:100

gnuplot plot [-30:30] [-10:500] (3*x*x - 8*x)

You can also do 3-d plots.
Here is the 3d plot of a complex function in 2d plane.

gnuplot splot [-30:30] [-10:500] (3*x*x - 8*x + y*y)

Has any one in here implemented this sort of a program ? Which library did
 you use ? if possible could you explain why you chose the particular
 library.


 Gnuplot is its own programming language, but if you want a Python
 interface, try gnuplot.py.

 http://gnuplot-py.sourceforge.net/





 -- shiv
 ___
 BangPypers mailing list
 BangPypers@python.org
 http://mail.python.org/mailman/listinfo/bangpypers




-- 
--Anand
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] 2D plotting libraries.

2010-06-04 Thread Vinayak Hegde
How about mathplotlib ? I haven't used it (yet but am planning to play
with it for visualisation). What are the other good visualisation
libraries for python.

-- Vinayak

On Fri, Jun 4, 2010 at 1:01 PM, Anand Balachandran Pillai
abpil...@gmail.com wrote:
 On Fri, Jun 4, 2010 at 12:13 PM, Shiv Shankar fsla...@gmail.com wrote:

 Hello,

 I have a finite 2 dimensional plane. I have a set of co-ordinates, which is
 basically the movement of an object.
 The co-ordinates are derived from a set of equations considering various
 factors.
 After a set of initial research and tryouts i *quickly *decided on using *
 pygame* to plot the co-ordinates on a 2D plane.


  Wrong choice. When a software exists which is the perhaps the most
 powerful plotting program *ever* written, choosing a gaming library
 for this demonstrates poor choice, unless there is a specific reason
  for that - like for example, if you are already familiar with Pygame or
  SDL.

 I am talking about gnuplot here.

 The commands are pretty intuitive. It gives you an interactive
 prompt, like python. For example, here is how to plot
 a curve for the function (3*x*x - 8*x) over x range of -50:50
 and y-range of -10:100

 gnuplot plot [-30:30] [-10:500] (3*x*x - 8*x)

 You can also do 3-d plots.
 Here is the 3d plot of a complex function in 2d plane.

 gnuplot splot [-30:30] [-10:500] (3*x*x - 8*x + y*y)

 Has any one in here implemented this sort of a program ? Which library did
 you use ? if possible could you explain why you chose the particular
 library.


  Gnuplot is its own programming language, but if you want a Python
  interface, try gnuplot.py.

  http://gnuplot-py.sourceforge.net/





 -- shiv
 ___
 BangPypers mailing list
 BangPypers@python.org
 http://mail.python.org/mailman/listinfo/bangpypers




 --
 --Anand
 ___
 BangPypers mailing list
 BangPypers@python.org
 http://mail.python.org/mailman/listinfo/bangpypers

___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] 2D plotting libraries.

2010-06-04 Thread Anand Balachandran Pillai
On Fri, Jun 4, 2010 at 1:15 PM, Vinayak Hegde vinay...@gmail.com wrote:

 How about mathplotlib ? I haven't used it (yet but am planning to play
 with it for visualisation). What are the other good visualisation
 libraries for python.


You mean matplotlib. It is a Python library meant for plotting
and not a separate application like gnuplot. I haven't used it yet, but
I understand there is some initial learning involved. Not sure if
it is amenable for a rookie.



 -- Vinayak

 On Fri, Jun 4, 2010 at 1:01 PM, Anand Balachandran Pillai
 abpil...@gmail.com wrote:
  On Fri, Jun 4, 2010 at 12:13 PM, Shiv Shankar fsla...@gmail.com wrote:
 
  Hello,
 
  I have a finite 2 dimensional plane. I have a set of co-ordinates, which
 is
  basically the movement of an object.
  The co-ordinates are derived from a set of equations considering various
  factors.
  After a set of initial research and tryouts i *quickly *decided on using
 *
  pygame* to plot the co-ordinates on a 2D plane.
 
 
   Wrong choice. When a software exists which is the perhaps the most
  powerful plotting program *ever* written, choosing a gaming library
  for this demonstrates poor choice, unless there is a specific reason
   for that - like for example, if you are already familiar with Pygame or
   SDL.
 
  I am talking about gnuplot here.
 
  The commands are pretty intuitive. It gives you an interactive
  prompt, like python. For example, here is how to plot
  a curve for the function (3*x*x - 8*x) over x range of -50:50
  and y-range of -10:100
 
  gnuplot plot [-30:30] [-10:500] (3*x*x - 8*x)
 
  You can also do 3-d plots.
  Here is the 3d plot of a complex function in 2d plane.
 
  gnuplot splot [-30:30] [-10:500] (3*x*x - 8*x + y*y)
 
  Has any one in here implemented this sort of a program ? Which library
 did
  you use ? if possible could you explain why you chose the particular
  library.
 
 
   Gnuplot is its own programming language, but if you want a Python
   interface, try gnuplot.py.
 
   http://gnuplot-py.sourceforge.net/
 
 
 
 
 
  -- shiv
  ___
  BangPypers mailing list
  BangPypers@python.org
  http://mail.python.org/mailman/listinfo/bangpypers
 
 
 
 
  --
  --Anand
  ___
  BangPypers mailing list
  BangPypers@python.org
  http://mail.python.org/mailman/listinfo/bangpypers
 
 ___
 BangPypers mailing list
 BangPypers@python.org
 http://mail.python.org/mailman/listinfo/bangpypers




-- 
--Anand
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] 2D plotting libraries.

2010-06-04 Thread Shiv Shankar
 Wrong choice. When a software exists which is the perhaps the most
 powerful plotting program *ever* written, choosing a gaming library
 for this demonstrates poor choice, unless there is a specific reason
  for that - like for example, if you are already familiar with Pygame or
  SDL.


Its a strategical game anyways. But that no way justifies my choice for the
library. Ill try out GNUplot.
Does GNUPlot have something like py2app in pygame ?
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] 2D plotting libraries.

2010-06-04 Thread Anand Balachandran Pillai
On Fri, Jun 4, 2010 at 2:57 PM, Shiv Shankar fsla...@gmail.com wrote:

  Wrong choice. When a software exists which is the perhaps the most
  powerful plotting program *ever* written, choosing a gaming library
  for this demonstrates poor choice, unless there is a specific reason
   for that - like for example, if you are already familiar with Pygame or
   SDL.
 

 Its a strategical game anyways. But that no way justifies my choice for the
 library. Ill try out GNUplot.
 Does GNUPlot have something like py2app in pygame ?


 Well, I might have misunderstood you. I thought you wanted to plot
the output of your program separately, not tied to your main
application. Looks like you want the plotting to be done in the app.
Then matplotlib is a better choice, since it is a library and can
be used directly in code.


 ___
 BangPypers mailing list
 BangPypers@python.org
 http://mail.python.org/mailman/listinfo/bangpypers




-- 
--Anand
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] 2D plotting libraries.

2010-06-04 Thread Noufal Ibrahim
On Fri, Jun 4, 2010 at 2:57 PM, Shiv Shankar fsla...@gmail.com wrote:
[/..]
 Its a strategical game anyways.

This changes things. What kind of app are you trying to make?

-- 
~noufal
http://nibrahim.net.in
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] 2D plotting libraries.

2010-06-04 Thread Noufal Ibrahim
On Fri, Jun 4, 2010 at 3:52 PM, Shiv Shankar fsla...@gmail.com wrote:
 This changes things. What kind of app are you trying to make?


 War game, every one writes their own strategies to derive movement based on
 a intercommunication between objects. Objects are bots and one teams bot
 kills the others. Still in the drawing board.

The user specified strategies control movement?

If that's the case, you simply have to use the graphics library you're
using for your game. I don't think you'll be able to use
gnuplot/matplotlib/PIL etc.



-- 
~noufal
http://nibrahim.net.in
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] 2D plotting libraries.

2010-06-04 Thread Kenneth Gonsalves
On Friday 04 June 2010 15:52:16 Shiv Shankar wrote:
  This changes things. What kind of app are you trying to make?
 
 War game, every one writes their own strategies to derive movement based on
 a intercommunication between objects. Objects are bots and one teams bot
 kills the others. Still in the drawing board.
 

strange - this is what I am doing!
-- 
Regards
Kenneth Gonsalves
Senior Associate
NRC-FOSS at AU-KBC
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] 2D plotting libraries.

2010-06-04 Thread Kenneth Gonsalves
On Friday 04 June 2010 16:24:16 Shiv Shankar wrote:
 Kenneth - how are you communicating between nodes ? I have watch towers
 which watch on nodes and act as mutual communication points.
 

havent reached that stage yet - what has happened is that my favourite game 
used to be xconq - but it no longer runs on modern systems and is not 
maintained, so I am developing a clone. I just started learning pygame 
yesterday for this purpose. Just a mite surprised that some one else is doing 
this too.
-- 
Regards
Kenneth Gonsalves
Senior Associate
NRC-FOSS at AU-KBC
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] 2D plotting libraries.

2010-06-04 Thread Kenneth Gonsalves
On Friday 04 June 2010 16:26:57 Anand Balachandran Pillai wrote:
  strange - this is what I am doing!
 
  Wow - is game programming so popular now a days ?
  I never tried it myself.
 

don't - it is addictive, your wife and kid will never see you again ;-)
-- 
Regards
Kenneth Gonsalves
Senior Associate
NRC-FOSS at AU-KBC
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] 2D plotting libraries.

2010-06-04 Thread Noufal Ibrahim
I enjoy it quite a bit. The whole ode thing I've prepared for the
pycon in Singapore is an attempt. With the libraries available,
independant games are more feasible than ever.

On 6/4/10, Anand Balachandran Pillai abpil...@gmail.com wrote:
 On Fri, Jun 4, 2010 at 4:15 PM, Kenneth Gonsalves law...@au-kbc.org wrote:

 On Friday 04 June 2010 15:52:16 Shiv Shankar wrote:
   This changes things. What kind of app are you trying to make?
 
  War game, every one writes their own strategies to derive movement based
 on
  a intercommunication between objects. Objects are bots and one teams bot
  kills the others. Still in the drawing board.
 

 strange - this is what I am doing!


  Wow - is game programming so popular now a days ?
  I never tried it myself.

 --
 Regards
 Kenneth Gonsalves
 Senior Associate
 NRC-FOSS at AU-KBC
 ___
 BangPypers mailing list
 BangPypers@python.org
 http://mail.python.org/mailman/listinfo/bangpypers




 --
 --Anand
 ___
 BangPypers mailing list
 BangPypers@python.org
 http://mail.python.org/mailman/listinfo/bangpypers



-- 
~noufal
http://nibrahim.net.in
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] 2D plotting libraries.

2010-06-04 Thread Shiv Shankar
  Wow - is game programming so popular now a days ?
  I never tried it myself.


When has game programing lost its popularity ?

 The whole ode thing I've prepared for the
 pycon in Singapore is an attempt.


What was it ?
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] 2D plotting libraries.

2010-06-04 Thread Noufal Ibrahim
On Fri, Jun 4, 2010 at 6:49 PM, Shiv Shankar fsla...@gmail.com wrote:

  The whole ode thing I've prepared for the
 pycon in Singapore is an attempt.

http://github.com/nibrahim/Devious-machinations

Let me see how well it's received. If it's good, I'll present it here
at the local BangPypers meetings if there's sufficient interest.
It's a simple game that ties up a physics engine (ODE) and a graphics
library (PyGame). A clone of the famous TIM
(http://en.wikipedia.org/wiki/The_Incredible_Machine)

-- 
~noufal
http://nibrahim.net.in
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] 2D plotting libraries.

2010-06-04 Thread Rahul R
On Fri, Jun 4, 2010 at 5:22 PM, Noufal Ibrahim nou...@gmail.com wrote:

 On Fri, Jun 4, 2010 at 6:49 PM, Shiv Shankar fsla...@gmail.com wrote:

   The whole ode thing I've prepared for the
  pycon in Singapore is an attempt.

 http://github.com/nibrahim/Devious-machinations

 Let me see how well it's received. If it's good, I'll present it here
 at the local BangPypers meetings if there's sufficient interest.
 It's a simple game that ties up a physics engine (ODE) and a graphics
 library (PyGame). A clone of the famous TIM
 (http://en.wikipedia.org/wiki/The_Incredible_Machine)

 --
 ~noufal
 http://nibrahim.net.in
 _



I would love to  see that . besides there is one more game engine called
panda3D http://www.panda3d.org/ built by carniege mellon univ students , i
liked it .



 __
 BangPypers mailing list
 BangPypers@python.org
 http://mail.python.org/mailman/listinfo/bangpypers

___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] 2D plotting libraries.

2010-06-04 Thread Shiv Shankar

 http://github.com/nibrahim/Devious-machinations

 Let me see how well it's received. If it's good, I'll present it here
 at the local BangPypers meetings if there's sufficient interest.
 It's a simple game that ties up a physics engine (ODE) and a graphics
 library (PyGame). A clone of the famous TIM


Nice.
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers