In [15]:
# General linear mapping
# A matrix A has two linearly independent columns.

A3 = np.zeros( (2,2))

A3[0,0] = 3./2
A3[0,1] = -1/2
A3[1,0] = 1./2
A3[1,1] = -1./2

X_new_mesh_3 = A3[0,0] * x_mesh + A3[0,1] * y_mesh
Y_new_mesh_3 = A3[1,0] * x_mesh + A3[1,1] * y_mesh

plt.scatter(X_new_mesh_3, Y_new_mesh_3, c=y_mesh)
plt.axis('equal')
Out[15]:
(-22.00985663082437, 22.009856630824373, -11.015176600441501, 11.0151766004415)