Michael Ji
Michael Ji

Reputation: 167

Function for ploting a matrix in ipython using matplotlib

I have created a matrix:

s1=np.random.randn(1000,1000)
v1=la.eigvals(s1)
matrix1=np.matrix(v1)

I want to plot the matrix in ipython.

What appropriate matplotlib function should I use?

Upvotes: 0

Views: 514

Answers (1)

Hooked
Hooked

Reputation: 88158

A very simple example to "plot" a matrix:

import numpy as np
import pylab as plt

S  = np.random.randn(100,100)

# Make symmetric so everything is real
S += S.T
W,V = np.linalg.eigh(S)

import pylab as plt
plt.imshow(V,interpolation="none")
plt.show()

enter image description here

Upvotes: 1

Related Questions