I am trying show the effect of multiplying a matrix with unit column vectors [1, 0] and [0, 1]. This is done by showing the unit vectors before and after on a cartesian plane. Shown below is an image of the original unit vectors before transformation and the unit vectors after the transformation. How do I get the unit grid on the right to be aligned with the new transformed unit vectors using matplotlib?
Code for unit grid on the left:
grid_x_ticks = np.arange(-1, 1, 0.2)
grid_y_ticks = np.arange(-1, 1, 0.2)
ax1.set_xticks(grid_x_ticks, minor=True)
ax1.set_yticks(grid_y_ticks, minor=True)
ax1.grid(which='both')
ax1.grid(which='minor', alpha=0.2, linestyle='--')
Here M is a table input from the user (2x2), e1 and e2 are the original unit vectors (left plot) Me1 and Me2 are the new unit vectors (right plot):
M = inputs['m']
M = np.asarray(M)
e1 = np.array([1, 0])
e1 = e1.astype(float)
e2 = np.array([0, 1])
e2 = e2.astype(float)
Me_1 = np.matmul(M, e1)
Me_2 = np.matmul(M, e2)