Re: Just drawing lines and plotting points?

Discussion in 'Python' started by Terry Reedy, Jan 27, 2010.

  1. Terry Reedy

    Terry Reedy Guest

    On 1/26/2010 7:54 PM, Chris Rebert wrote:
    > On Tue, Jan 26, 2010 at 4:36 PM, Someone Something<> 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?
    Terry Reedy, Jan 27, 2010
    #1
    1. Advertising

  2. Terry Reedy

    rantingrick Guest

    On Jan 26, 9:38 pm, Terry Reedy <> wrote:
    > On 1/26/2010 7:54 PM, Chris Rebert wrote:
    >
    > > On Tue, Jan 26, 2010 at 4:36 PM, Someone Something<>  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()
    rantingrick, Jan 27, 2010
    #2
    1. Advertising

  3. * rantingrick:
    > On Jan 26, 9:38 pm, Terry Reedy <> wrote:
    >> On 1/26/2010 7:54 PM, Chris Rebert wrote:
    >>
    >>> On Tue, Jan 26, 2010 at 4:36 PM, Someone Something<> 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
    Alf P. Steinbach, Jan 27, 2010
    #3
  4. Terry Reedy

    rantingrick Guest

    On Jan 26, 10:52 pm, "Alf P. Steinbach" <> wrote:
    > * rantingrick:
    >
    >
    >
    >
    >
    > > On Jan 26, 9:38 pm, Terry Reedy <> wrote:
    > >> On 1/26/2010 7:54 PM, Chris Rebert wrote:

    >
    > >>> On Tue, Jan 26, 2010 at 4:36 PM, Someone Something<>  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


    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...?

    ;-)
    rantingrick, Jan 27, 2010
    #4
  5. * rantingrick:
    > On Jan 26, 10:52 pm, "Alf P. Steinbach" <> wrote:
    >> * rantingrick:
    >>
    >>
    >>
    >>
    >>
    >>> On Jan 26, 9:38 pm, Terry Reedy <> wrote:
    >>>> On 1/26/2010 7:54 PM, Chris Rebert wrote:
    >>>>> On Tue, Jan 26, 2010 at 4:36 PM, Someone Something<> 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

    >
    > 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
    Alf P. Steinbach, Jan 27, 2010
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Carl Gilbert

    Plotting points on a web page

    Carl Gilbert, Mar 7, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    535
    bruce barker
    Mar 7, 2005
  2. Bob Perlman

    Plotting points with DISLIN

    Bob Perlman, Jul 31, 2003, in forum: Python
    Replies:
    2
    Views:
    494
    Francis Barnhart
    Aug 1, 2003
  3. Jason

    Plotting points to screen

    Jason, Sep 26, 2005, in forum: Python
    Replies:
    3
    Views:
    358
    Fredrik Lundh
    Sep 26, 2005
  4. Rasmus Kjeldsen

    Plotting 3d points

    Rasmus Kjeldsen, Feb 10, 2008, in forum: Python
    Replies:
    4
    Views:
    620
    Rasmus Kjeldsen
    Feb 11, 2008
  5. tt-industries
    Replies:
    8
    Views:
    2,506
    lcampagn
    Jun 19, 2012
Loading...

Share This Page