Ask Your Question
1

Argand diagram plot

asked 2017-08-20 04:40:07 -0500

ortollj gravatar image

updated 2017-08-20 06:07:22 -0500

HI

T=[-sqrt(1/2*sqrt(13) + 1) - I*sqrt(1/2*sqrt(13) - 1),
 -sqrt(1/2*sqrt(13) + 1) + I*sqrt(1/2*sqrt(13) - 1),
 -sqrt(1/2*sqrt(13) + 1) +I*sqrt(1 + sqrt(13)/2),
 -sqrt(1/2*sqrt(13) + 1) -I*sqrt(1 + sqrt(13)/2) ]

what is the best , fastest, way to plot Argand diagram of T ?

edit retag flag offensive close merge delete

Comments

I edited the array, but imagine the values in the table could be real or complex

ortollj gravatar imageortollj ( 2017-08-20 05:52:50 -0500 )edit

Sorry for this basic question, but I did not succeed I tried this below, without success. Could someone tell me what's wrong ? I wanted to use points(TP):

T=[-sqrt(1/2*sqrt(13) + 1) - I*sqrt(1/2*sqrt(13) - 1),
 -sqrt(1/2*sqrt(13) + 1) + I*sqrt(1/2*sqrt(13) - 1),
 -sqrt(1/2*sqrt(13) + 1) +I*sqrt(1 + sqrt(13)/2),
 -sqrt(1/2*sqrt(13) + 1) -I*sqrt(1 + sqrt(13)/2) ]
TP=[]
for k in range(0,len(T)) :
            TP.append((T[k].real_part(), T[k].imag_part()))
show(TP)
ortollj gravatar imageortollj ( 2017-08-20 10:12:15 -0500 )edit

points(TP) works for me (Sage v8.0). what went wrong?

the function show is also ok and prints a "nice" expression in latex form (use view(TP) to see it rendered).

mforets gravatar imagemforets ( 2017-08-20 10:23:00 -0500 )edit

yes it is also working, Stupidly, I thought my show (TP) was wrong, because I saw trigo formulas in the result !. so I did not even try point(TP) !!!

ortollj gravatar imageortollj ( 2017-08-20 10:44:41 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
2

answered 2017-08-20 10:14:36 -0500

mforets gravatar image

updated 2017-08-20 10:51:52 -0500

point2d accepts complex arguments:

sage: point2d((CC(Ti) for Ti in T))

it admits a lot of optional parameters, here just some of them are being used:

sage: point2d((CC(Ti) for Ti in T), pointsize=50, marker='x', color='red')

a bunch of arrows can be added using arrow2d:

sage: sum([point2d((CC(Ti))) + arrow2d((0, 0), CC(Ti), color='black') for Ti in T])
edit flag offensive delete link more

Comments

1

Thanks a lot mforets You will not believe it, but I spent more than 1 hour looking how to do it. And no success :)

ortollj gravatar imageortollj ( 2017-08-20 10:27:15 -0500 )edit
2

answered 2017-08-20 12:24:14 -0500

dan_fulea gravatar image

list_plot(T) also does the job.

edit flag offensive delete link more

Comments

Yes list_plot(T) does too ! It's not charitable, Dan_fullea, now I'm ashamed to have opened this post. :(

ortollj gravatar imageortollj ( 2017-08-21 11:09:20 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-08-20 04:40:07 -0500

Seen: 58 times

Last updated: Aug 20