Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

plotting arrow in python

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


bnrj.rudra at gmail

Nov 21, 2009, 1:24 PM

Post #1 of 6 (588 views)
Permalink
plotting arrow in python

Dear friends,
I am very new in python. Actually, I think I will not do much python
then using it to plotting data. I have not done any "real" thing in
python, so plz be easy. Now , the problem
I have a data set:
0.0 0.0 0.1
0.0 0.1 0.1
0.1 0.0 0.5

like that! the first two column are coordinate and 3rd one is
magnitude of moment (say: x y,m)!! so what i want to do is draw an
arrow of magnitude(m) in the position (x,y).
I know how python read array, and how to draw an array(via
matplotlib)...but totally confused with this one.
can you people plz help?
--
http://mail.python.org/mailman/listinfo/python-list


stef.mientki at gmail

Nov 21, 2009, 3:19 PM

Post #2 of 6 (567 views)
Permalink
Re: plotting arrow in python [In reply to]

rudra wrote:
> Dear friends,
> I am very new in python. Actually, I think I will not do much python
> then using it to plotting data. I have not done any "real" thing in
> python, so plz be easy. Now , the problem
> I have a data set:
> 0.0 0.0 0.1
> 0.0 0.1 0.1
> 0.1 0.0 0.5
>
> like that! the first two column are coordinate and 3rd one is
> magnitude of moment (say: x y,m)!! so what i want to do is draw an
> arrow of magnitude(m) in the position (x,y).
> I know how python read array, and how to draw an array(via
> matplotlib)...but totally confused with this one.
> can you people plz help?
>
maybe take a look at VPython
cheers,
Stef
--
http://mail.python.org/mailman/listinfo/python-list


lie.1296 at gmail

Nov 21, 2009, 5:36 PM

Post #3 of 6 (560 views)
Permalink
Re: plotting arrow in python [In reply to]

rudra wrote:
> Dear friends,
> I am very new in python. Actually, I think I will not do much python
> then using it to plotting data. I have not done any "real" thing in
> python, so plz be easy. Now , the problem
> I have a data set:
> 0.0 0.0 0.1
> 0.0 0.1 0.1
> 0.1 0.0 0.5
>
> like that! the first two column are coordinate and 3rd one is
> magnitude of moment (say: x y,m)!! so what i want to do is draw an
> arrow of magnitude(m) in the position (x,y).
> I know how python read array, and how to draw an array(via
> matplotlib)...but totally confused with this one.
> can you people plz help?

If you want to stay with regular python distribution, take a look on
pygame (http://www.pygame.org/ ).

If you want to avoid 3rd party modules, take a look at turtle and
Tkinter in the standard library.
--
http://mail.python.org/mailman/listinfo/python-list


rt8396 at gmail

Nov 21, 2009, 6:01 PM

Post #4 of 6 (565 views)
Permalink
Re: plotting arrow in python [In reply to]

On Nov 21, 7:36 pm, Lie Ryan <lie.1...@gmail.com> wrote:
(..snip..)
> If you want to avoid 3rd party modules, take a look at turtle and
> Tkinter in the standard library.

Just to add to Ryans words...
If you want to avoid 3rd party modules, take a look at turtle and the
Tkinter *Canvas* widget in the standard library. Here is an example.

#-- start code --#
try:
import Tkinter as tk
except ImportError:
import tkinter as tk #python 3+

app = tk.Tk()
canvas = tk.Canvas(app)
canvas.create_line(0,0, 50,50, arrow='last')
canvas.pack()
app.mainloop()
#-- end code --#

remove the try/except when you know which one to use. I just wanted to
make sure it ran out-the-box for you, have fun!
--
http://mail.python.org/mailman/listinfo/python-list


greg.ewing at canterbury

Nov 21, 2009, 9:58 PM

Post #5 of 6 (561 views)
Permalink
Re: plotting arrow in python [In reply to]

> rudra wrote:
>
>> 0.0 0.0 0.1
>> 0.0 0.1 0.1
>> 0.1 0.0 0.5
>>
>> like that! the first two column are coordinate and 3rd one is
>> magnitude of moment (say: x y,m)!! so what i want to do is draw an
>> arrow of magnitude(m) in the position (x,y).

There seems to be some information missing there.
How do you know what direction to draw the arrow in?

--
Greg
--
http://mail.python.org/mailman/listinfo/python-list


bnrj.rudra at gmail

Nov 22, 2009, 4:30 AM

Post #6 of 6 (552 views)
Permalink
Re: plotting arrow in python [In reply to]

On Nov 22, 6:58 am, Gregory Ewing <greg.ew...@canterbury.ac.nz> wrote:
> > rudra wrote:
>
> >> 0.0 0.0 0.1
> >> 0.0 0.1 0.1
> >> 0.1 0.0 0.5
>
> >> like that! the first two column are coordinate and 3rd one is
> >> magnitude of moment (say: x y,m)!! so what i want to do is draw an
> >> arrow of magnitude(m) in the position (x,y).
>
> There seems to be some information missing there.
> How do you know what direction to draw the arrow in?
>
> --
> Greg

Greg,
you are right direction is also needed. But as a beginner, I am trying
to make it simple and all arrows are collinear along x axis!!
then i have to try non collinear as well.
thank you
--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.