Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Just drawing lines and plotting points?

1 view
Skip to first unread message

Chris Rebert

unread,
Jan 26, 2010, 7:54:56 PM1/26/10
to Someone Something, pytho...@python.org
On Tue, Jan 26, 2010 at 4:36 PM, Someone Something <fordh...@gmail.com> wrote:
> Hello,
>
> I need a python library that makes drawing lines and plotting points (these
> two things are the only things I need to do) easy. Or, how can I do
> something like this with pygame? Basically, what I want to do is make
> graphs. In pygame, since the coordinate system switches the x's and the y's
> I would have to switch them again when I plot my points so my graphs look
> okay. I hope this was enough info for me to get a good answer.

matplotlib, perhaps?: http://matplotlib.sourceforge.net/

Cheers,
Chris
--
http://blog.rebertia.com

Terry Reedy

unread,
Jan 26, 2010, 10:38:45 PM1/26/10
to pytho...@python.org

or dislin?

Message has been deleted

Alf P. Steinbach

unread,
Jan 26, 2010, 11:52:13 PM1/26/10
to
* rantingrick:

> On Jan 26, 9:38 pm, Terry Reedy <tjre...@udel.edu> wrote:
>> On 1/26/2010 7:54 PM, Chris Rebert wrote:
>>
>>> On Tue, Jan 26, 2010 at 4:36 PM, Someone Something<fordhai...@gmail.com> wrote:
>>>> Hello,
>>>> I need a python library that makes drawing lines and plotting points (these
>>>> two things are the only things I need to do) easy. Or, how can I do
>>>> something like this with pygame? Basically, what I want to do is make
>>>> graphs. In pygame, since the coordinate system switches the x's and the y's
>>>> I would have to switch them again when I plot my points so my graphs look
>>>> okay. I hope this was enough info for me to get a good answer.
>>> matplotlib, perhaps?:http://matplotlib.sourceforge.net/
>> or dislin?
>
> it doesn't get any easier than the tkCanvas widget...
>
> import Tkinter as tk
> #import tkinter as tk #python3.0+
> app = tk.Tk()
> canvas = tk.Canvas(app)
> canvas.pack()
> canvas.create_line(sx,sy, ex,ey)
> #...
> #...
> app.mainloop()

He he, it's even easier to draw a graph using the turtle module.

Cheers,

- Alf

Message has been deleted

Alf P. Steinbach

unread,
Jan 27, 2010, 9:05:40 AM1/27/10
to
* rantingrick:
> Yes Alf please forgive me, i had completely forgotten about the
> "visual" learners amongst us.
>
> turtle, turtle, watch him go...
> turtle, turtle, why he so slow...
> turtle, turtle, not even he don't know...?
>
> ;-)

Uhm, that is a misconception.

Just do

turtle.hideturtle()
turtle.tracer( 0 )

to turn off the animation stuff.

That said, the turtle module bundled with Python is somewhat limited, but for
plotting simple graphs it's certainly simpler than using tkinter directly.


Cheers & hth.,

- Alf

0 new messages