# Plotting eigenvalues in complex plane

Would you please tell how I can define a random matrix whose entries are 1, 0 and plot its eigenvalues in the complex plane?

Plotting eigenvalues in complex plane

add a comment

1

can do

```
sage: point2d(random_matrix(ZZ, 10, 10, x=0, y=2).charpoly().roots(CDF, False))
```

@vdelecroix Thanks, if I want to do this for several times, I checked the following code, but it didn't work

```
for i in range(5):
point2d(random_matrix(ZZ, 10, 10, x=0, y=2).charpoly().roots(CDF, False), size=50)
```

Is it correct?

@Sébastien that depends on the size of the matrix.

@salam: if the code would have been correct it would run. Just learn how to make a loop in Python. But to get several pictures, it might be more convenient to use graphics_array.

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

Asked: ** 2020-04-18 00:58:31 +0100 **

Seen: **413 times**

Last updated: **Apr 18 '20**

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.