In [4]:
A = np.array([[3, 1],
              [0, 2]])

print(np.linalg.det(A))
6.0
In [5]:
origin = np.zeros(A.shape)

plt.figure(figsize=(6,6))
plt.quiver(*origin, *A, color=['r','g','b'], scale=1, units='xy')

plt.grid()
plt.xlim(-4,4)
plt.ylim(-4,4)
plt.gca().set_aspect('equal')
plt.show()
In [6]:
A_inv = np.linalg.inv(A)

print(A_inv)
[[ 0.33333333 -0.16666667]
 [ 0.          0.5       ]]
In [7]:
b = np.dot(A, A_inv)
origin = np.zeros(b.shape)

plt.figure(figsize=(6,6))
plt.quiver(*origin, *b, color=['r','g','b'], scale=1, units='xy')

plt.grid()
plt.xlim(-4,4)
plt.ylim(-4,4)
plt.gca().set_aspect('equal')
plt.show()