Just drawing lines and plotting points?

Alf P. Steinbach alfps at start.no
Tue Jan 26 23:52:13 EST 2010


* rantingrick:
> On Jan 26, 9:38 pm, Terry Reedy <tjre... at 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... at 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



More information about the Python-list mailing list